Network Files System NFS uses rpc portmap. It allocates random UDP port number to NFS server for I/O operation. Dont worry to set portmapper. It will work by default. In case you want to see if its working use command
ps -aux | grep portmap
To see port number assigned to various services by portmapper use command
Various services need to be setup for NFS are NFS, netfs, amd and autofs. To check if NFS is installed use command
rpm -qa | grep nfs
To secure the NFS you would normally disable all unnecessary services in hosts.allow. A typical hosts.allow would look like below.
Now to export a particular directory open /etc/export file and write the following line
To export directory issue command
It will update /var/lib/nfs/xtab. If you change /etc/exports and want immediate effect use
Then no reboot is necessary.
On the client side use command
showmount --exports servername
amd and autofs are two automatic mounting systems. Use anyone if necessary.
UID and GID should be same across all client and servers. If /etc/export is changed issue command
exportfs -r on client
To mount it in on client use command
mount servername:/home/use rname1 /home/username2
This mounts home directory of two users.