Setting up NFS on Ubuntu 16.04

Make sure userid’s and groupid’s match between the systems

  • e.g. usermod -u 1001 -g 504 -c "Andrew Fountain" andrewf

Set up the server

  • set up the fully qualified domain name, e.g.
vi /etc/hosts         # ensure it contains the line:
vi /etc/idmapd.conf   # ensure it contains the line: Domain = (not the name of the server but the domain)
hostnamectl set-hostname
#pre sytemed edit /etc/hostname manually, and also run hostname
  • install the software
apt install nfs-kernel-server
vi /etc/exports
  • create a line for each directory to be exported
    sharediry client-ip-range(share_options1,...)
  • e.g.:
ufw status #see if firewall turned on. If so, will need to run: ufw allow ...
systemctl restart nfs-kernel-server
#for 14.04:
exportfs -a
service nfs-kernel-server start

Set up the client

  • make sure /etc/idmapd.conf contains Domain = FQDN
apt install nfs-common
sv3:/   /home/andrewsv3    nfs noatime,actimeo=1800,rsize=8192,wsize=8192 0 0
david:/ /home/andrew/d  nfs noatime,actimeo=1800,rsize=8192,wsize=8192,nolock,nfsvers=4 0 0