How to allow root access to NFS?

On local filesystems, root usually has full access (read/write) to directories/files inside of it.

But for NFS directory mounted from nework, root usually has no permission to write to it. How to make root act as on local directory for NFS directory?

The reason that NFS directory is non-accessible to root is likely “root_squash”.

It assigns them the user ID for the user nfsnobody and prevents root users connected remotely from having root privileges. This prevents unauthorized alteration of files on the remote server.

To disable root_swash, set the no_root_squash option. It turns off root squashing.

For example, to disable root_swash for /mnt/a. The line in /etc/exports can be:

/mnt/a 10.0.0.0/16(rw,no_root_squash)
Answered by Eric Z Ma.

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *