Professional Documents
Culture Documents
Once ready, used your favorite text editor and create a new NFS export entry within /etc/exports
configuration file. For example :
/var/nfs-export *(rw,sync,no_subtree_check,no_root_squash)
The above export will export /var/nfs-export directory to any host with any IP address with
read-write access. This is a highly unsecure export. For more NFS export examples enter $ man
exports.
To apply changes within /etc/exports configuration file, reload all NFS exports with:
# exportfs -ra
The command showmount -e lists the available shares on your local machine (NFS
Server). The out
# showmount -e 127.0.0.1
If you wish to start your NFS server after reboot, you need enable it with systemctl systemd
command:
# systemctl enable nfs-kernel-server
Synchronizing state of nfs-kernel-server.service with SysV service script with
/lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nfs-kernel-server
NFS Client
Now that the NFS export directory is available to a remote mount. Let's install NFS client on our client
system:
# apt-get install nfs-common
Create a new directory which will be used as a NFS mount point to remotely mount previously
exported /var/nfs-export directory:
# mkdir /mnt/nfs
he command showmount -e lists the available shares on your local machine (NFS Server). The out
# showmount -e 192.168.0.5
# df -hT
To mount NFS shares automatically on every reboot, you need to edit /etc/fstab file on your client
system.
vi /etc/fstab
Reboot the client machine and check whether NFS share is automatically mounted or not.
reboot
Verify the mounted share on the client-server using the mount command.
mount | grep nfs
• La segunda será una lista de opciones para compartir. Entre las opciones que podemos utilizar,
se encuentran las siguientes:
• ro(read-only): La carpeta compartida será de sólo lectura. Es la opción predeterminada.
• rw (read-write): El usuario podrá realizar cambios en el contenido de la carpeta
compartida.
• wdelay: El servidor NFS no escribe en el disco si espera otra solicitud de forma
inminente. Así se reducen los accesos a disco y mejora el rendimiento. Es la opción
predeterminada, pero sólo funciona cuando usamos la opción sync.
• no_wdelay: Deshabilita la característica anterior.
• root_squash: Evita que los usuarios con privilegios administrativos los mantengan, sobre
la carpeta compartida, cuando se conectan remotamente. En su lugar, se les trata como a
un usuario remoto más. Es la opción predeterminada.
• no_root_squash: Deshabilita la característica anterior.
• sync: Evita responder peticiones antes de escribir los cambios pendientes en disco. Es la
opción predeterminada.
• async: Deshabilita la característica anterior. Mejora el rendimiento a cambio de que
exista el riesgo de corrupción en los archivos o, incluso, en todo el sistema de archivos,
si se produjese una interrupción del fluido eléctrico o un bloqueo del sistema.
• subtree_check: Cuando el directorio compartido es un subdirectorio de un sistema de
archivos mayor, NFS comprueba los directorios por encima de éste para verificar sus
permisos y características. Es la opción predeterminada.
• no_subtree_check: Deshabilita la característica anterior, lo que hace que el envío de la
lista de archivos sea más rápido, pero puede reducir la seguridad.