LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   NFS subdirectory - regular user can read - root user denied (https://www.linuxquestions.org/questions/linux-software-2/nfs-subdirectory-regular-user-can-read-root-user-denied-4175596396/)

qajaq 12-29-2016 08:35 AM

NFS subdirectory - regular user can read - root user denied
 
I've set up a file server using nfs4 and included the following lines in my file-server's /etc/exports file:
Code:

/share 192.168.0.30(rw) 192.168.0.40(rw)
/share/datalib 192.168.0.30(rw) 192.168.0.40(rw)

Now, as a regular user on the 192.168.0.40 machine, I can read and write to any file anywhere in the shared directory tree, even in levels beyond the two levels listed in the server's exports file.

However, as root user, I have permission only to read or write to files immediately in those two specified directories. When I try to list files one level beyond those two, I get a "Permission denied" error message.

The relevant UIDs and GIDs are identical on both machines. And even aside from that, I thought the root user should have universal permissions, no?

What could be going on to prevent the root user having access to files that a regular user can fully manipulate?

cliffordw 12-29-2016 09:12 AM

Hi there,

Have a look at "man exports", and in particular the "User ID Mapping" section. It says:

Quote:

Very often, it is not desirable that the root user on a client machine is also treated as root when accessing files on the NFS
server. To this end, uid 0 is normally mapped to a different id: the so-called anonymous or nobody uid. This mode of operation
(called `root squashing') is the default, and can be turned off with no_root_squash.
I hope this helps

qajaq 12-29-2016 12:59 PM

Yes, that did help completely. Thank you very much!


All times are GMT -5. The time now is 02:50 AM.