Problem with nfs sharing, permission denied for writing.

Hi

I have a problem with NFS sharing on solaris 10, the problem simply with write permission, after do the following command, the folder still not writable from machine 2 :

on machine 1 (10.10.10.32) :

share -F nfs -o rw /u01/portalrepository/

on machine 2 (10.10.10.31) :

 mount -F nfs 10.10.10.32:/u01/portalrepository/ /u01/portalrepository/

I make some stupid solution, chmod 777 for portalrepository and successfully upload files but not for sub-directories.

Please, Can you help me?

As what user do you try to upload the files?

as root, and I tried to use FTP program to upload file , and use touch command to create a new file.

FTP message : open for write: permission denied
touch command message : test.txt cannot create

Thanks

When you want to have rw access as root user, then you need to share that directory using:

share -F nfs -o rw root=host /u01/portalrepository/

Where "host" can be a hostname or IP address of the computer that is going to mount that directory and use it as root.

I got this message :

share -F nfs -o rw root=10.10.10.31 /u01/portalrepository/
share_nfs: root=10.10.10.31: No such file or directory

Sorry, it should be:

share -F nfs -o rw,root=10.10.10.31 /u01/portalrepository/

Sorry, this command does not solve my problem , still cannot create file, I type share and the result:

/u01/portalrepository   rw,root=10.10.10.31   ""

what now?

Well, did you remounted this directory at 10.10.10.31, and then tried accessing it as root?

Yes, I did

using :

umount -f /u01/portalrepository

then

mount -f nfs 10.10.10.32:/u01/portalrepository/ /u01/portalrepository

but still have this problem.

please note I test to create a file and upload a file into sub-directory inside /u01/portalrepository

...
Thanks,

---------- Post updated at 04:47 PM ---------- Previous update was at 06:36 AM ----------

any help more !

i am also, facing the same issue. i couldnt write into the /kingston directory unless and until i gave 757 permission for the directory in nfs server. The command i have given is

share -F nfs -o rw,root=10.205.17.178 /kingston

When i try to write, it gives " permission denied " error.

Try

share -F nfs -o rw,root=@10.10.10.31 /u01/portalrepository/

Can you show the permissions (ls -ld /u01/portalrepository/)

drwxrwxrwx   5 root     root         512 Jun 28 15:49 /u01/portalrepository/

Look, its now 777 , but it was 755 and this problem was same, now as i said before, it's just stupid solution as a temporary solution made it 777, but the problem still in sub-directory, I can't make this for all subs , because it always created by a portal, and the subs numbers maybe in thousands !!!

What system is mounting that directory? Another Solaris?

No, the two machines are the same (same system specification and same operation system version)

after running the more /etc/release command in the both the result was :

in m1

# more /etc/release
                       Solaris 10 5/08 s10s_u5wos_10 SPARC
           Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 24 March 2008

in m2

# more /etc/release
                       Solaris 10 5/08 s10s_u5wos_10 SPARC
           Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                             Assembled 24 March 2008

machine1 = NFS Server
machine2 = NFS client
/rootfolder = folder to be shared
/mountpoint = mount point on the client

1 - unmount and unshare the folder (just to start afresh)
2 - on the server side:

share -F nfs -o rw=machine2 /rootfolder

3 - on the client side:

mount -F nfs -o rw machine1:/rootfolder /mountpoint

Note: assuming machine1 and machine2 are in the /etc/hosts file
Note: userid (not username) on server and client side should be the same. Since you are share and accessing as root (UID=0), it shouldnot be a problem.

No, accessing NFS shares as root is a problem because the default is for the root user to be mapped to the nobody user.

Are your servers both in the same NFSv4 authentication domain (/var/run/nfs4_domain) ?

Thanks, but that does not solve my problem, still deny writing from machine2.

Then, What should I do now?

This file is exist, but it's empty too !

NFSv4 doesn't map user ids like previous versions did. You should put your machines in the same domain (i.e. put the same domain name in both files, I don't think empty domains match together). Using root is also a bad practice, you'd rather use a non system account for your transfers.

Downgrading to NFSv3

mount -F nfs -o vers=3,...

might also fix some issues.