Install NFS server

apt-get install nfs-kernel-server

Create NFS directories

mkdir /mnt/nfsshare

Edit /etc/exports

nano /etc/exports

 

(inside the exports file write this)

 

/mnt/nfsshare *(anonuid=501,insecure,all_squash,ro) 

Save the changes

sudo exportfs -ra

Reload NFS Server

systemctl reload nfs-server.service

See the sharing path

showmount -e localhost

 

Export list for localhost:

 

/mnt/nfsshare  *

Mount NFS on Linux

mount serverIP:/mnt/nfsshare /home/seba/NFS/

Mount NFS on Mac

sudo mount -t nfs -o vers=4 -o tcp -o resvport -w serverIP:/mnt/nfsshare/ /Users/seba/NFS/