Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

NFS Server

Direct answer

An NFS server exports directories listed in /etc/exports (or /etc/exports.d/) with client lists and options such as rw, ro, sync, root_squash and sec=.

When to use this

Use it to publish NFS exports, or when clients are denied access.

First 30 seconds

1. systemctl status nfs-server.

2. exportfs -v — export and options as intended?

3. Edit /etc/exports, then exportfs -ra.

4. Firewall allows nfs (and rpc-bind, mountd for v3).

5. Server log: journalctl -u nfs-server.

Operational verification

/etc/exports → exportfs loads → nfs-server serves → client allowed by its address

Evidence · next step

For File Services → NFS Server, continue with the first unproven Topic check: Record export source, effective client match/options, NFS version and backend mount identity. If that boundary is healthy, advance to the adjacent check: Read back effective exports and listener/service state rather than trusting edited files. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Key commandsystemctl status nfs-server
Scope / prerequisiteUse it to publish NFS exports, or when clients are denied access.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

exports source → effective export table → nfs server services → client match/options → identity squash/map → backend path/mount → filesystem permission/LSM → NFS response

Healthy evidence: effective exports match source intent, server services listen, client match/options are correct, backend path is mounted as intended and mapped identity has required access

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Record export source, effective client match/options, NFS version and backend mount identity.

  • Read back effective exports and listener/service state rather than trusting edited files.
  • Resolve mapped identity and test backend access plus the same operation through NFS.
  • Apply the minimal export/service/filesystem fix, reload safely and retest from the original client.

Verification chain. exports source → effective export table → nfs server services → client match/options → identity squash/map → backend path/mount → filesystem permission/LSM → NFS response

Step 3 Specialized verification Verify boundary

Inspect the effective export table, server listeners/services and the backing mount. Test from a representative client address and identity using the intended NFS version, then perform real file operations. Correlate server-side logs/counters and filesystem permissions. If access differs by client, show which export rule matched. A successful showmount-style listing is not enough for NFSv4 behavior or data access; verify the actual mount and I/O.

Step 4 Commands Verify boundary
cat /etc/exports
exportfs -ra
systemctl status nfs-server
Step 5 Failure modes and next checks Narrow the fault

Suspicious evidence: edited exports were not reloaded, overlapping client rules select different options, root_squash surprises identity, backend mount/path differs, or firewall/RPC services do not match protocol version

Step 6 Special cases and limits Narrow the fault

Export policy is separate from Unix permissions and SELinux/AppArmor on the server. root_squash changes effective identity and can make root-client tests misleading. A server can export a path on the wrong backing mount. Network reachability and RPC discovery do not show file access. Keep listener/protocol, export match/options, backing filesystem/identity and client operation distinct.

Step 7 Common mistakes Narrow the fault
  • Exporting to * instead of specific clients.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

After editing run exportfs -ra. Client specifications are exact (host, subnet, wildcard) — a space between client and options changes the meaning. Open the firewall (firewall-cmd --add-service=nfs).

Key checks
  • showmount -e <server> / exportfs -v — NFS exports
  • findmnt -t nfs,nfs4,cifs — mounted network shares
  • smbclient -L //<server> -U <user> — SMB shares
  • testparm -s — Samba configuration check
ReferenceImportant terms & boundaries6 sections · depth on demand

What this shows and what it does not

The server boundary is confirmed when the intended client matches the intended effective export options and the mapped server identity can perform the backend operation.

In depth

Running an NFS server: exports and identity mapping

An NFS server publishes directories in /etc/exports, or files in /etc/exports.d/. The exports(5) manual page defines the format:

  • Each line is an export path followed by clients, each with options in parentheses, with no space between client and options.
  • Clients can be host names, addresses, networks in CIDR form, wildcards or netgroups.
  • The defaults are ro, sync, root_squash and no_subtree_check.
  • async is faster, but the manual warns it can lose or corrupt data after an unclean server restart.
  • root_squash maps client root to the anonymous ID 65534, all_squash maps every user, and anonuid/anongid choose the IDs.
  • sec=sys:krb5p lists the accepted security flavours.
  • exportfs -ra applies changes.

Export options in practice

OptionUse
rwWritable export (the default is read-only)
syncKeep the default; acknowledge writes only after they're stable
root_squashKeep the default; client root gets no root powers on the server
no_root_squashOnly for special cases, e.g. diskless clients
all_squash,anonuid=1500,anongid=1500Every user maps to one account (shared upload areas)
sec=krb5pKerberos authentication and encryption

A watch-out in the syntax

/srv/share 10.110.0.0/16 (rw) with a space before the parenthesis exports read-only to 10.110.0.0/16, and read-write to everyone. The space makes (rw) apply to "any host". exportfs -v shows the result.

Server setup

host$ sudo dnf install -y nfs-utils || sudo apt install -y nfs-kernel-server
host$ sudo mkdir -p /srv/nfs/projects && sudo chown root:projects /srv/nfs/projects && sudo chmod 2770 /srv/nfs/projects
host$ echo '/srv/nfs/projects 10.110.0.0/16(rw,sync,root_squash,sec=sys) 10.99.0.25(ro,sync)' | sudo tee /etc/exports.d/projects.exports
host$ sudo exportfs -ra && sudo exportfs -v | grep projects
/srv/nfs/projects 10.110.0.0/16(sync,wdelay,hide,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)
/srv/nfs/projects 10.99.0.25(sync,wdelay,hide,no_subtree_check,sec=sys,ro,secure,root_squash,no_all_squash)
host$ sudo systemctl enable --now nfs-server
host$ sudo firewall-cmd --permanent --add-service=nfs && sudo firewall-cmd --reload
host$ cat /proc/fs/nfsd/versions
-3 +4 +4.1 +4.2

Reading the example

The project area is writable for the office network, and read-only for the backup server. Root squashing is on for both. /proc/fs/nfsd/versions shows that NFSv3 is disabled, so only NFSv4 on port 2049 needs to be open in the firewall.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

NFS Server is part of File Services → NFS Server. NFS Server operation is the authoritative export and backend side: export configuration, effective export table, NFS service endpoints, client matching, squashing/identity semantics and filesystem access.

Topic-specific state model. NFS Server operation is the authoritative export and backend side: export configuration, effective export table, NFS service endpoints, client matching, squashing/identity semantics and filesystem access.

Interpretation rule. - /etc/exports text ≠ effective export table.

  • Export visibility ≠ client authorization for every operation.
  • root on the client ≠ root on the server when squashing applies.
  • Backend path existing ≠ the intended filesystem is mounted there.

Specialized mechanics

An NFS server combines export policy with kernel/user-space NFS services and a backing filesystem. Export entries match clients and apply options such as rw/ro, root squashing and synchronization behavior. NFSv4 additionally exposes a pseudo-filesystem namespace and stateful protocol features. The server can be listening while a specific export is absent, mismatched to the client identity/network or backed by an unhealthy local filesystem. Protocol versions expose different discovery and state boundaries, so NFSv3 rpcbind-related state and NFSv4 namespace/stateful behavior should not be conflated.

Quick reference

NFS server setup:

dnf install nfs-utils   # or apt install nfs-kernel-server
cat >> /etc/exports <<'EOT'
/srv/projects 10.0.20.0/24(rw,sync,no_subtree_check,root_squash)
EOT
exportfs -rav
systemctl enable --now nfs-server
firewall-cmd --permanent --add-service=nfs --add-service=mountd --add-service=rpc-bind; firewall-cmd --reload

Tune /etc/nfs.conf ([nfsd] threads=32, enable/disable versions). sync is the safe default; async risks data loss on server crash.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. The server boundary is confirmed when the intended client matches the intended effective export options and the mapped server identity can perform the backend operation.

DNS success does not show protocol reachability.

ReferenceConfiguration & state2 sections · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. NFS Server owns export-side policy and service state; NFS Client owns mount/session behavior.

Specialized lifecycle

Define exports with explicit client scope and the minimum required permissions. Understand root_squash/no_root_squash and anonymous identity mappings before changing them. Reload/export changes through the supported exportfs/service path and keep persistent files authoritative. Ensure the exported path is a stable mount if expected; exporting an underlying directory before another filesystem mounts over it can expose the wrong content. Firewall and NFS version choices should match the intended client population.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in File Services → NFS Server. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.samba.org/samba/docs/ · confidence 94%
2026-09-13 · vendor docLinux NFS server / nfs-utils current

Authoritative Linux project/vendor documentation reviewed for bounded reference claims: export policy, client matching, export options and server-side access boundary. Documentation-based technical verification only; not lab or production-runtime proof. The schema vendor_doc method is used for authoritative project/vendor documentation; deployment applicability remains separate evidence.

Basis: https://man7.org/linux/man-pages/man5/exports.5.html · confidence 93%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
nfs serverlinux nfs servernfs exports
Embedded reference data

Quick lookup tables

NFS Server operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for NFS Server.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateNFS Server operation is the authoritative export and backend side: export configuration, effective export table, NFS service endpoints, client matching, squashing/identity semantics and filesystem access.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact client/server + time + request/file operation → identify authoritative configuration → read back effective service/listener/session state → trace protocol selection/auth/identity → verify backend/upstream boundary → correlate logs → make smallest persistent change → repeat original workload + regression check.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainexports source → effective export table → nfs server services → client match/options → identity squash/map → backend path/mount → filesystem permission/LSM → NFS responseTrace requested/configured state through effective state to the observed workload result.
Failure boundaryThe server boundary is proven when the intended client matches the intended effective export options and the mapped server identity can perform the backend operation.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux web/file-service evidence can establish this proof path: exports source → effective export table → nfs server services → client match/options → identity squash/map → backend path/mount → filesystem permission/LSM → NFS responseUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove unobserved clients, names, identities, routes, sessions, backends or time periods. The server boundary is proven when the intended client matches the intended effective export options and the mapped server identity can perform the backend operation.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven service boundary, capture adjacent effective state and protocol/application evidence, make only the demonstrated persistent change, then repeat the original client workload plus a regression check.Continue to the next unresolved boundary while preserving the original test condition.

NFS Server · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryNFS Server
Topic pathFile Services → NFS Server
Runtime stateNFS Server operation is the authoritative export and backend side: export configuration, effective export table, NFS service endpoints, client matching, squashing/identity semantics and filesystem access.
Fast checks- Record export source, effective client match/options, NFS version and backend mount identity. - Read back effective exports and listener/service state rather than trusting edited files. - Resolve mapped identity and test backend access plus the same operation through NFS. - Apply the minimal export/service/filesystem fix, reload safely and retest from the original client.
Verification chainexports source → effective export table → nfs server services → client match/options → identity squash/map → backend path/mount → filesystem permission/LSM → NFS response Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Failure boundaryThe server boundary is proven when the intended client matches the intended effective export options and the mapped server identity can perform the backend operation. Boundary chain: unit config/drop-ins → dependency/order/condition → exec/process → readiness/active state → owned socket/file/device → dependent client/workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.

NFS Server · specialized operational reference

Topic-specific Linux mechanics, lifecycle, proof path and failure-boundary lookup.

Operational boundaryTopic-specific reference
Policyexport path + client match + options
Identityroot_squash / anonymous mapping + filesystem ownership
BackingVerify exported path is on intended mount
ProofRepresentative remote client performs intended I/O
Confirmation

Confirm action

Continue?