Configurer un Serveur et Client NFS

Côté Serveur

Installation du serveur NFS sur Debian :

apt install nfs-kernel-server

Configuration du Serveur :

vi /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)
#

/home/storage/ 5.135.53.246/255.255.255.255(rw,no_root_squash,sync)

Reload de la configuration :

# exportfs -a

Côté Client

Installation du client NFS :

apt install nfs-common

Configuration FSTAB :

vi /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=54ff86a0-4dfb-4647-b453-db6a439664b6 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=f7dd5fab-01d1-454f-8ea2-8215e7a1e629 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
62.210.83.4:/home/storage   /home/nfs_mp/storage   nfs    user,noauto,rw,exec    0   2

Monter manuellement un point NFS :

# mount -t nfs YOUR-NFS-SERVER-IP:/var/nfs-export /mnt/nfs/
Back to top