A very good and detailed guide is https://help.ubuntu.com/community/SettingUpNFSHowTo
You can set up NFS following the guidance from the link above.
To simplify it, here is the steps:
1. Install NFS using apt-get or Synaptic Package Manager;
2. Add the IP and name of hosts into /etc/hosts;
3. Add the following line to /etc/hosts.deny:
portmap mountd nfsd statd lockd rquotad : ALL
4. Add the following line to /etc/hosts.allow:
portmap mountd nfsd statd lockd rquotad : list of IP addresses
5. Edit /etc/exports and add the shares:
/home 192.168.0.10(rw,sync,no_subtree_check) 192.168.0.11(rw,sync,no_subtree_check)
/usr/local 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)
The above shares /home and /usr/local to two clients with fixed ip addresses. Best used only with machines that have static ip addresses.
6. After setting up /etc/exports, export the shares:
sudo exportfs -ra
7. Restart Services
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart
8. At NFS client, install portmap and nfs-common;
9. Add the following line to /etc/hosts.deny:
portmap : ALL
10. Add the following line to /etc/hosts.allow:
portmap : NFS server IP address
11. Mount the shared folder by:
sudo mount ServerIP:/folder/already/setup/to/be/shared /home/username/folder/in/your/local/computer
12. In /etc/fstab, add lines for shares such as:
servername:dir /mntpoint nfs rw,hard,intr 0 0
No comments:
Post a Comment