Pcornel
Storage · NFS

Root Squash

Cheat sheet · https://pcornel.dk/topic.php?topic=4142

Back to the Topic

Answer

The server rewrites or maps remote UID 0 according to export policy before normal filesystem authorization. This reduces trust in client-side root but does not make an export read-only or replace filesystem permissions.

Remember

  • Root squash ≠ read-only export.
  • Client root ≠ server root when squashed.
  • no_root_squash ≠ required for normal NFS operation.
  • Root squash ≠ encryption or authentication.

First checks

  • exportfs -v | grep -o 'root_squash\|no_root_squash' — squash setting
  • touch /mnt/nfs/testfile (as root) && ls -ln — root mapped to nobody?
  • cat /etc/exports — options

Commands

sudo

Verify in this order

client root → squashed to anon UID

Where it usually breaks

First mismatch in client identity/DNS → network transport → protocol session → authentication/authorization → export/share → backend filesystem → file operation; preserve identity/pre-state before mutation.

NFS → Root Squash file-service map

File-service boundaryWhat to verifyProof limit
Endpoint / namespaceCorrect client, server, export/share, path and negotiated protocol versionReachability or namespace visibility does not prove authorization or backend health
Identity / securityEffective identity, protocol security state and export/share/filesystem authorizationAuthentication or one permission layer does not prove complete file access
Failure boundaryRoot squash changes the identity used for remote root requests; it does not itself define read/write export mode, ordinary user mapping or backend health.Correlate client, network, server and filesystem evidence for the same operation/time window
AcceptanceHealthy evidence: root requests map exactly as designed, non-root access is unaffected as expected and server-side ownership confirms the effective credential.Close only after the original operation and server-side/read-back verification succeeds

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4142

Confirmation

Confirm action

Continue?