1 deploy NFSServer side 11 install nfs-kernel-serversudoapt-getinstallnfs-kernel-server12 configure etchostsdenyvietchostsdeny add content in the file NFSDAEMONSportmap: ALLlockd: ALLmount 1. deploy NFS Server side 1.1 install nfs-kernel-server
Sudo apt-get install nfs-kernel-server
1.2 configure/etc/hosts. deny
Vi/etc/hosts. deny
# Add content to the file
### NFSDAEMONS
Portmap: ALL
Lockd: ALL
Mountd: ALL
Rquotad: ALL
Statd: ALL
1.3 configure/etc/hosts. allow
Vi/etc/hosts. allow
# Add content to the file
### NFSDAEMONS
Portmap: client IP address
Lockd: client IP address
Rquotad: client IP address
Mountd: client IP address
Statd: client IP address
1.4 restart portmap deamon
/Etc/init. d/portmap restart
1.5 configure/etc/exports
If you share the/home directory of 192.168.71.205 to 192.168.71.46, add
/Home 192.168.71.46 (rw, sync, no_root_squash)
Note:
(1) rw is read/write permission, and read-only is ro;
(2) sync data is synchronously written to the memory and hard disk, and async data is saved in the memory before being written to the hard disk;
(3) the no_root_squash server shares the attributes of the Directory user. if the user is root, the shared directory has the root permission.
1.6 restart the NFS service
/Etc/init. d/nfs-kernel-serverrestart
2. deploy NFS client 2.1 to install nfs-common
Sudo apt-get install nfs-common
2.2 Mount NFS
For example, Mount/home/of the 192.168.71.205 NFS server to the NFS client of 192.168.71.46 and run the following command on the machine 192.168.71.46:
Mount-t nfs-o tcp, soft, intr, timeo = 50, retrans = 12,192.168 .71.205: /home/testclient (the two directories must already exist on the two machines ).
2.3 check whether the mounting is successful
Df
2.4 uninstall
Unmount/home/testclient