Debian (Jessie) – Server nfs
Vediamo come installare e configurare un server nfs su debian.
- Installiamo il software:
# apt-get install nfs-kernel-server nfs-common
...
Creating config file /etc/exports with new version
...
- Come evidenziato verifichiamo che esista il file /etc/exports, tale file inoltre contiene degli esempi:
# cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
- Aggiungo l'autorizzazione per il server 10.0.5.5 in scrittura sulla cartella /shares all'interno della home di utente1:
# echo "/home/utente1/shares 10.0.5.5(rw,sync,no_subtree_check)" >> /etc/exports
- Ogni volta che si modifica il file /etc/exports bisogna avvisare il sistema di aggiornare la propria configurazione col comando exportfs:
# exportfs -a
- Riavviamo questa volta per sicurezza il servizio nfs server:
# /etc/init.d/nfs-kernel-server restart
[ ok ] Restarting nfs-kernel-server (via systemctl): nfs-kernel-server.service.