Operating System - Linux
1822959 Members
3743 Online
109645 Solutions
New Discussion юеВ

Re: Permission denied on linux NFS

 
Edwin Ruiz_2
Super Advisor

Permission denied on linux NFS

Hi!
I have one linux's file system mounted on a HP-UX server like NFS file system, but.. if i want to change into this file system i get th folowing message
oragt01 / >cd /linux
sh: /linux: Permission denied.
Why ?
5 REPLIES 5
Jerome Henry
Honored Contributor

Re: Permission denied on linux NFS

Hi,

Make sure your UID is the same on both ends, particularly user number on Linux box must be the same as on the other end.
Check also that NFS has been restarted after export on Linux box...

hth

J
You can lean only on what resists you...
Steven E. Protter
Exalted Contributor

Re: Permission denied on linux NFS

id command for the user on both sides.

on Linux
service nfs restart

HP
/sbin/init.d/nfs.server stop
/sbin/init.d/nfs.core stop

/sbin/init.d/nfs.server start
/sbin/init.d/nfs.core start

exportfs -av

after making NFS changes on the HP side:

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mark Grant
Honored Contributor

Re: Permission denied on linux NFS

Also, just make sure the permissions actually allow you to. "ls -ld /linux". On some systems I have seen that the permissions of the mount point itself make a difference too.
Never preceed any demonstration with anything more predictive than "watch this"
K.C. Chan
Trusted Contributor

Re: Permission denied on linux NFS

what is your nfs mount option, make sure you set "-o rw". what does df or bdf show?
Reputation of a thousand years can be determined by the conduct of an hour
Bob_Vance
Esteemed Contributor

Re: Permission denied on linux NFS

The above info on UIDs is correct, but if you are 'root' on oragt01, then there is another possible problem:

The linux directory was exported with "root_squash" (which is the default).

In this case, the remote root user id is "squashed" to the user "nobody" on the linux server. Then, the user "nobody" must have the appropriate permissions (local to the linux server) to the exported directory.

So, 2 possible fixes:

. you must export the directory in way to let remote root have access. This is accomplished with the "no_root_squash" in the /etc/exports file.

. fix the linux-local permissions on the directory for access by (local) user "nobody.

E.g.:
winky ## exportfs -v | sed 's/^/. /'
. /mnt/cdrom *(ro,async,wdelay,no_root_squash)
. /var/tmp *(rw,async,wdelay,root_squash)

notice the root_squash on "/var/tmp".

winky ## ll -d /var/tmp | sed 's/^/. /'
. dr--r--r-- 2 root root 1024 Nov 3 10:27 /var/tmp

Notice that "nobody" would not have (local) write permission on this directory.

linux1 ## mount | grep winky | sed 's/^/. /'
. winky:/var/tmp on /mnt/nfs type nfs (rw,bg,intr,soft,addr=192.168.1.7)

notice that on the remote server, the directory is imported with read-write.

But,
linux1 ## id | sed 's/^/. /'
. uid=0(root) gid=0(root) groups=0(root)
linux1 ## touch /mnt/nfs/f2 2>&1 | sed 's/^/. /'
. touch: /mnt/nfs/f2: Permission denied

this error is because "root" is squashed to "nobody".
Let's fix it

winky ## chmod 777 /var/tmp
linux1 ## touch /mnt/nfs/f2

notice no error, now :)

linux1 ## ll /mnt/nfs | sed 's/^/. /'
. total 2
. drwxrwxrwx 2 root root 1024 Nov 3 10:43 .
. drwxr-xr-x 5 root root 1024 Nov 2 09:44 ..
. -rw-r--r-- 1 65534 65534 0 Nov 3 10:27 f1
. -rw-r--r-- 1 65534 65534 0 Nov 3 10:43 f2


bv
"The lyf so short, the craft so long to lerne." - Chaucer