Skip to content

Instantly share code, notes, and snippets.

@staplerfahrer
Last active June 21, 2021 17:52
Show Gist options
  • Select an option

  • Save staplerfahrer/a297d5e7b6434253e1f2841a8c1a5e8f to your computer and use it in GitHub Desktop.

Select an option

Save staplerfahrer/a297d5e7b6434253e1f2841a8c1a5e8f to your computer and use it in GitHub Desktop.
Quickly set up an NFS share on Ubuntu
server:
sudo su
apt update
apt install -y nfs-kernel-server
mkdir -p /mnt/nfsdir
chown nobody:nogroup /mnt/nfsdir
chmod 777 /mnt/nfsdir
vim /etc/exports
add a line: /mnt/nfsdir CLIENT_IP_HERE(rw,sync,no_subtree_check)
(wildcards allowed: /mnt/nfsdir *(rw,sync,no_subtree_check)
exportfs -a
systemctl restart nfs-kernel-server
(firewall: ufw allow from CLIENT_IP_HERE to any port nfs)
(ufw status)
client:
sudo su
apt update
apt install -y nfs-common
mkdir -p /mnt/nfsdir_client
mount SERVER_IP_HERE:/mnt/nfsdir /mnt/nfsdir_client
vim /etc/fstab
add a line: SERVER_IP_HERE:/mnt/nfsdir /mnt/nfsdir_client nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment