Debian/Ubuntu NFS Guide

apt-get install nfs-kernel-server nfs-common portmap

Edit /etc/exports

By default, portmap is only accessiable on localhost. You need clients to connect, so:

Remove the line '-i 127.0.0.1' option from ARGS in the file /etc/default/portmap

Restart it with /etc/init.d/portmap restart

Edit /etc/exports

/usr/local 192.168.1.(rw,no_root_squash,async)
/stuff 192.168.1.(ro,async)

no_root_squash means that the 'root' user on a client system going to this directory will be root on the server share as well. This is something you'll only want to use in a protected LAN. Otherwise, 'root' will be 'nobody' while in the shared directory. NEVER ALLOW NFS TO BE SHARED ACROSS THE INTERNET.

/etc/hosts.allow
portmap: 192.168.1.
lockd: 192.168.1.
rquotad: 192.168.1.
mountd: 192.168.1.
statd: 192.168.1.
nfs: 192.168.1.


/etc/hosts.deny
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL
nfs:ALL


To make everything easier, edit your /etc/hosts file. This should be the same on all linux machines.

192.168.1.100 laptop
192.168.1.101 server
192.168.1.104 workstation
You may have to '/etc/init.d/networking restart' to make this hosts file work.

Restart NFS.

/etc/init.d/nfs-kernel-server restart

Mount on the client machine now:

mount server:/usr/local /mnt/server-local

You'll probably want to add this to /etc/fstab.

server:/usr/local /mnt/sever-local nfs rsize=8192 0 0