Linux – Doesn’t NFSv4 have no_root_squash

centoslinuxnfs

When I in /etc/fstab have

nas:/tank/nobackup  /mnt/nas       nfs     exec,nosuid,rw,bg,soft 0 0

then mount -a; mount gives

nas:/tank/nobackup on /mnt/nas type nfs (rw,nosuid,bg,soft,vers=4,addr=10.10.10.10,clientaddr=10.10.10.11)

but creating a file in the mount point gives permission denied.

If I add no_root_squash to /etc/fstab when I get

mount.nfs: an incorrect mount option was specified

Question

Isn't no_root_squash supported on NFSv4? And if not, then which is the recommended?

Best Answer

no_root_squash is a server side (export) option, not a client side option. It therefore doesn't go in /etc/fstab, nor can it be specified to mount.

If you think about it - why would you want a client to be able to decide "hey, I'll be root today, that'll be nice"?

http://linux.die.net/man/5/exports

I'd suggest though, that rather than setting no_root_squash instead you want to set root=, and designate some specific clients to act as root.