Question & Answer
Question
Why is permission denied for root UID under AIX NFS?
Answer
Under AIX, root user has access to all files no matter what permission and ownership they have. However this super user permission may not be allowed on NFS server since anyone who can become super-user on their workstation could gain access to all remote files.
When NFS client tries to access an NFS mount as root (UID 0), it will get mapped to nobody user by default unless the client has been given explicit root access by NFS server (this means specifying option “root=<client>” on exportfs).
For example:
there is a dir /tmp/test with permission 755 and exported as “/tmp/test -sec=sys,rw”
When root user tries to create a file under this dir from NFS client, RPC request is sent to NFS server with UID=0, GID=0, and gets mapped to nobody, which has permission “5” (READ and EXECUTE), you will get WRITE 'permission denied' error.
One way to resolve this write permission denied problem is to give root access by the server in the /etc/exports file with the -root option. This would be the recommended method.
Example:
under /etc/exports:
change from:
/tmp/test -sec=sys,rw
to:
#To give root access to host 'nfs_client'
/tmp/test -sec=sys,rw, root=<nfs_client>
Another way to resolve the write permission would be given the world access with permission 777. However this would allow everyone have the same permission.
Was this topic helpful?
Document Information
More support for:
IBM Power Systems Enterprise Cloud Edition with AIX 7.2
Software version:
Version Independent
Operating system(s):
AIX
Document number:
632205
Modified date:
21 October 2021
UID
isg3T1025855