How to Set Up and Configure NFS Server and Clients
NFS is widely deployed and used even after more than twenty year. NFS is easy to set up and easy to use. This introduces how to set up the NFS server and clients. We use the Fedora system as the example.
Set up a NFS ServerConfigure /etc/exports to give clients the permission to use the NFS directories.
Edit /etc/exportsFor example, to allow the servers inside subnet 10.0.0.1/24 to mount the /home directory with read/write permission. Add this line to /etc/exports:
/home 10.0.0.1/24(rw)For details of the exports functions, please refer to export manual.
Start up the NFS serviceEnable nfs service on the NFS server so that the NFS service daemon automatically starts each time the server starts:
# /sbin/chkconfig nfs onYou may also manually start it
# service nfs start
Package installationInstall the nfs-utils package:
# yum nfs-utils
Start the rpcbind serviceStart the service needed by NFS:
# service rpcbind restartYou may also set it to start automatically
# chkconfig rpcbind on
Mount the NFS directoryYou can mount the NFS directory to the mount point:
# mount NFSSERVER:/lhome/userdir MOUNTPOINTwhere NFSSERVER is the NFS server’s address, and MOUNTPOINT is the local mount point on the client side for the NFS directory.
You may also consider using autofs on top of NFS as described in Unified Linux Login and Home Directory Using OpenLDAP and NFS/automount.