/etc/exports and /etc/exports.d/, lists the directories that are made available over the network (exported). For each NFS share, only the given list of machines is granted access. More fine-grained access control can be obtained with a few options. The syntax for this file is quite simple:
/directory/to/share machine1(option1,option2,...) machine2(...) ...
fsid=0 أو الخيار fsid=root.
*.falcot.com أو مجال من عناوين IP مثل 192.168.0.0/255.255.255.0 أو 192.168.0.0/24.
ro). يمنح الخيار rw صلاحيات القراءة والكتابة. يتصل عملاء NFS نموذجياً من منفذ مخصص للمستخدم الجذر (أي أنه أقل من 1024)؛ يمكن رفع هذا القيد باستخدام الخيار insecure (الخيار secure ضمني، لكن يمكن كتابته صراحة للتوضيح إذا اقتضت الحاجة).
sync)؛ لكن يمكن تعطيل هذا بالخيار async. تزيد عمليات الكتابة غير المتزامنة الأداء قليلاً، لكنها تخفض الموثوقية بسبب احتمال خسارة البيانات إذا انهار المخدم في الفترة ما بين إرسال تأكيد الكتابة وبين إنهاء الكتابة الفعلية على القرص. بما أن القيمة الافتراضية تغيرت مؤخراً (مقارنة بالقيمة التاريخية في NFS)، يُفضّل استخدام خيار صريح.
nobody user. This behavior corresponds to the root_squash option, and is enabled by default. The no_root_squash option, which disables this behavior, is risky and should only be used in controlled environments. If all users should be mapped to the user nobody, use all_squash. The anonuid=uid and anongid=gid options allow specifying another fake user to be used instead of UID/GID 65534 (which corresponds to user nobody and group nogroup).
sec لتحديد مستوى الحماية الذي تريد: sec=sys هو الافتراضي وليس له خصائص أمنية مميزة، أما المستوى sec=krb5 فيفعل المصادقة فقط، والمستوى sec=krb5i يضيف التحقق من سلامة المعلومات المنقولة، والمستوى sec=krb5p هو أكمل المستويات حيث يتضمن حماية الخصوصية (عبر تشفير البيانات). سوف تحتاج لإعداد Kerberos حتى تعمل هذه المستويات (هذه الخدمة غير مشروحة في هذا الكتاب).
mount command and the /etc/fstab file.
مثال 11.20. مدخلة NFS في الملف /etc/fstab
arrakis.internal.falcot.com:/shared /srv/shared nfs4 rw,nosuid 0 0
/shared/ 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.