NFS
Network File System
Enumeration
Enumeration
Use
nmap
scripts:
And the
showmount
command to list all the shares:
To look the configuration on the server side:
Configuration Options
Configuration Options
Access Options
Access Options
rw
: Allows clients to read from and write to the shared directory.ro
: Allows clients to only read from the shared directory.
Sync and Async Options
Sync and Async Options
sync
: Ensures all changes are written to disk before theNFS
server responds to the client. This is safer but slower.async
: Allows the server to respond before data is written to disk. This improves performance but can lead to data loss if the server crashes.
User Mapping Options
User Mapping Options
root_squash
: Maps root user requests from clients to thenfsnobody
user (or equivalent) on the server, restricting root access.no_root_squash
: Grants root user on the client the same privileges as root on the server. Use with caution, as it can lead to security risks.all_squash
: Maps all client users (including root) to thenfsnobody
user (or equivalent) on the server.no_all_squash
: Retains the originalUID
andGID
of non-root users from the client on the server. This is the default.anonuid=<UID>
: Sets theUID
of the anonymous user forall_squash
orroot_squash
. Default is65534
(nfsnobody
).anongid=<GID>
: Sets theGID
of the anonymous user. Default is65534
.
Security and Access Control
Security and Access Control
secure
: Requires clients to use a privileged port (below1024
) for communication. This is the default.insecure
: Allows clients to connect from any port, including unprivileged ports (above1024
). Necessary for some client configurations.no_subtree_check
: Disablessubtree
checking. Recommended for shared directories where the export does not match the actual filesystem hierarchy, as it improves performance.subtree_check
: Enablessubtree
checking. Verifies that the requested file is within the exported tree. This is the default.
Performance Options
Performance Options
no_wdelay
: Prevents theNFS
server from delaying writes. Useful when multiple clients write to the same file simultaneously.wdelay
: Causes the server to delay writes slightly to optimize performance when multiple write requests arrive. This is the default.
Client Specification
Client Specification
<IP>
: Specifies a single client IP (e.g.,10.10.10.1
).<subnet>
: Specifies a subnet (e.g.,10.10.10.0/24
).*
: Allows all clients to connect. Use cautiously as this is less secure.<hostname>
: Specifies a hostname for allowed clients.
Last updated