/etc/exports, listet die Verzeichnisse auf, die über das Netzwerk zur Verfügung gestellt werden (exported). Zu jeder NFS-Freigabe wird nur den Rechnern Zugang gewährt, die auf dieser Liste stehen. Eine feiner eingestellte Zugangskontrolle kann durch einige Optionen erzielt werden. Die Syntax dieser Datei ist recht einfach:
/freizugebendes/verzeichnis rechner1(option1,option2,...) rechner2(...) ...
fsid=0 or fsid=root.
*.falcot.com oder ein IP-Adressbereich wie 192.168.0.0/255.255.255.0 oder 192.168.0.0/24 verwendet wird.
ro) schreibgeschützt bereitgestellt. Die Option rw ermöglicht Schreibzugriff. NFS-Clients nehmen typischerweise über einen Port Verbindung auf, der Administratorrechte erfordert (mit anderen Worten, unterhalb von 1024); diese Einschränkung kann mit der Option insecure aufgehoben werden (die Option secure ist stillschweigend eingestellt, kann aber auch ausdrücklich angegeben werden, wenn dies der Deutlichkeit halber erforderlich ist).
sync option); this can be disabled with the async option. Asynchronous writes increase performance a bit, but they decrease reliability since there is a data loss risk in case of the server crashing between the acknowledgment of the write and the actual write on disk. Since the default value changed recently (as compared to the historical value of NFS), an explicit setting is recommended.
nobody. Dieses Verhalten entspricht der Option root_squash und ist standardmäßig aktiviert. Die Option no_root_squash, die dieses Verhalten abstellt, ist gefährlich und sollte nur in überwachten Umgebungen eingesetzt werden. Die Optionen anonuid=uid und anongid=gid ermöglichen es, anstelle von UID/GID 65534 (was dem User nobody und der Gruppe nogroup entspricht) einen anderen fingierten Benutzer anzugeben.
sec option to indicate the security level that you want: sec=sys is the default with no special security features, sec=krb5 enables authentication only, sec=krb5i adds integrity protection, and sec=krb5p is the most complete level which includes privacy protection (with data encryption). For this to work you need a working Kerberos setup (that service is not covered by this book).
mount und der Datei /etc/fstab erforderlich.
Beispiel 11.22. Manuelles Einhängen mit dem Befehl mount
# mount -t nfs4 -o rw,nosuid arrakis.internal.falcot.com:/shared /srv/sharedBeispiel 11.23. NFS-Eintrag in der Datei /etc/fstab
arrakis.internal.falcot.com:/shared /srv/shared nfs4 rw,nosuid 0 0
/shared/ NFS directory from the arrakis server into the local /srv/shared/ directory. Read-write access is requested (hence the rw parameter). The nosuid option is a protection measure that wipes any setuid or setgid bit from programs stored on the share. If the NFS share is only meant to store documents, another recommended option is noexec, which prevents executing programs stored on the share. Note that on the server, the shared directory is below the NFSv4 root export (for example /export/shared), it is not a top-level directory.