Root Squash
Cheat sheet · https://pcornel.dk/topic.php?topic=4142
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 settingtouch /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 boundary | What to verify | Proof limit |
|---|---|---|
| Endpoint / namespace | Correct client, server, export/share, path and negotiated protocol version | Reachability or namespace visibility does not prove authorization or backend health |
| Identity / security | Effective identity, protocol security state and export/share/filesystem authorization | Authentication or one permission layer does not prove complete file access |
| Failure boundary | Root 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 |
| Acceptance | Healthy 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