Why Chown on a file/directory to the root user does not respect NFSv4 no_root_squash?
Issue
- When mounting a NFSv4 mount point using the option '
no_root_squash', user 'root' can create files on that filesystem, and the ownership is correct:
[root@client ~]# touch /mnt/some/yyy
[root@client ~]# ls -l /mnt/some/yyy
-rw-r--r--. 1 root root 0 Oct 15 18:03 /mnt/some/yyy
But when using 'chown' to 'root:root', the ownership is changed to 'nobody:nobody':
[root@client ~]# chown root:root /mnt/some/yyy
[root@client ~]# ls -l /mnt/some/yyy
-rw-r--r--. 1 nobody nobody 0 Oct 15 18:03 /mnt/some/yyy
Client and server both have a FQDN, the domain is explicit in /etc/idmapd.conf and the file is the same.
- Why
chownfails to change ownership ofrootuser and sets the ownership asnobodyon NFS client? - Why
chowndoes not work forrootuser even when share is exported withno_root_squash?
Environment
- Red Hat Enterprise Linux 6.4
nfs-utils-1.2.3-36.el6nfs-utils-lib-1.1.5-6.el6kernel-2.6.32-358.18.1.el6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.