Why Chown on a file/directory to the root user does not respect NFSv4 no_root_squash?

Solution Unverified - Updated -

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 chown fails to change ownership of root user and sets the ownership as nobody on NFS client?
  • Why chown does not work for root user even when share is exported with no_root_squash?

Environment

  • Red Hat Enterprise Linux 6.4
  • nfs-utils-1.2.3-36.el6
  • nfs-utils-lib-1.1.5-6.el6
  • kernel-2.6.32-358.18.1.el6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content