NFS

NFS is a network filesystem commonly used for exporting filesystems for shared use in Linux/BSD environments.

Ensure that the running kernel was compiled with support for the NFS server (y == yes, m == module, n == no):

$ grep NFSD /boot/config-$(uname -r)
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
# CONFIG_NFSD_SCSILAYOUT is not set
# CONFIG_NFSD_FLEXFILELAYOUT is not set
# CONFIG_NFSD_V4_2_INTER_SSC is not set
CONFIG_NFSD_V4_SECURITY_LABEL=y

Install required packages for NFSv4:

sudo apt install nfs-kernel-server

Disable features required only for legacy NFS protocol versions:

sudo sed -ie 's/^NEED_STATD=.*/NEED_STATD="no"/' /etc/default/nfs-common
sudo sed -ie 's/^NEED_IDMAPD=.*/NEED_IDMAPD="yes"/' /etc/default/nfs-common
echo 'RPCMOUNTDOPTS="--manage-gids -N 2 -N 3"' | sudo tee -a /etc/default/nfs-common
sudo systemctl mask rpcbind.{service,socket}

Configure exports:

echo "export /example 10.0.244.0/255.255.255.0(rw,no_root_squash,subtree_check)" | sudo tee -a /etc/exports
sudo exportfs -a
sudo systemctl reload nfs-kernel-server

Children
  1. ACLs

Backlinks