Last Updated: February 25, 2016
·
1.837K
· herrbischoff

How to Use NFS (Server and Client)

Server

Install the NFS server package:

apt-get install nfs-kernel-server

Add share to /etc/exports with following mask:

<path>           <computer_name>(<options>)

/srv/all         *(rw,async,no_subtree_check)
/srv/restricted  192.168.0.0/24(rw,async,no_subtree_check)

When serving to Mac OS X clients, you need to add insecure to the options. The Darwin default is to assume an "insecure" port, i.e. > 1024.

/srv/restricted  192.168.0.0/24(rw,async,no_subtree_check,insecure)

Reload export file:

exportfs -ra

Client

Show available mounts for a NFS server:

showmount -e <server>

Simply mount:

mount 192.168.0.200:/srv/all /mnt/nfs-server

For mounting at boot time, add something like this to /etc/fstab:

192.168.0.200:/srv/all /mnt/nfs-server nfs rw 0 0

Links

1 Response
Add your response

I never needed to set up NFS so far, but I thought it's more complex than that! Thanks for sharing :)

over 1 year ago ·