NFS File sharing¶
First there was NFS - it was written to share files over trusted networks (cos back then everyone trusted everyone else, and wore flowers in their hair.) The program that supports this is nfsd.
Then came SMB/CIFS which did not trust everyone, and was built to work with WIndows machines. THe program that supports this is SAMBA.
Then people started to really miss NFS, so they made it work with Kerberos.
This chapter starts with NFS, and then moves onto NFS with Kerberos. For file sharing within a windows domain see the chapter on SAMBA.
We need a server and a client.
This needs to run nfsd (which handles incoming requests) and mountd (which deals with actually sending receiving the files). rpcbind is also needed so clients can see what port the nfsd is on.
rpcbind_enable="YES" nfs_server_enable="YES" mountd_flags="-r"
This gets everyone. NFS cannot deal with (in fact for security is designed not to deal with) exporting from the server a path witha symlink in it. If you find that the mounting on the client is failing with permission denied, suspect this first. To check tail /var/log/messages. You will almost certainly find a message like
Apr 27 12:39:35 paullaptop mountd: mount request denied from 10.137.1.42 for /usr/home/pbrian/workspace/projects/projects/build_system/trunk/bsdbasebuild/new
now if I look at my /etc/exports
/root/workspace/projects/projects/build_system/trunk/bsdbasebuild/new -maproot=root belmarsh belmarsh2
lrwxr-xr-x 1 root wheel 22B Dec 11 11:11 workspace -> /home/pbrian/workspace
(yes, I am evil and am running as root)
so I solve it by altering the /etc/exports to
then I give NFS a kick (do this whenever adjusting /etc/exports)
kill -HUP `cat /var/run/mountd.pid`