Install services
Apt-Get install Portmap
Apt-Get install nfs-kerver-Server
Start the service
/Etc/init. d/Portmap restart
/Etc/init. d/nfs-kernel-server restart
NFS depends on RPC Portmap. You must register a port with it when starting. Therefore, you must ensure that Portmap is running;
Configuration File
/Etc/exports is used to set the publishing directory and permissions
Log Files
/Var/lib/nfs/etab shared directory details
/Var/lib/nfs/xtab client connection records
To publish the main directory of kdjie, configure as follows:
/Home/kdjie * (RW, sync, no_root_squash, no_subtree_check)
* Indicates that all users are allowed to access the service. It can be 192.168.9.0/24 192.168.9. *.
Sync indicates synchronous writing to memory and Hard Disk
No_root_squash indicates that when the client is root, the ing is an anonymous account statd (see/etc/passwd)
Related commands
Exportfs command line management release directory, Main Parameter
-H help
-R re-export/etc/exports
-A: export all directories in/etc/exports (add method)
-V: view the currently released directory, as shown in figure
Root @ kdjie-desktop:/etc # exportfs-V
/Home/kdjie
<World> (RW, wdelay, no_root_squash, no_subtree_check)
Showmount: displays the publishing and usage of the shared directory of a specified host. Main parameters:
-H help
-E [host]: view the published shared directory list
-D [host] to check which directories are mounted
Root @ kdjie-desktop:/etc # showmount-e
Export list for kdjie-desktop:
/Home/kdjie/d_test *
Root @ kdjie-desktop:/etc # showmount-d
Directories on kdjie-desktop:
/Home/kdjie/d_test
Rcpinfo view RPC details, main parameters
-P [host]: print the RPC details of the specified host
-U host name program number prints the RPC Information of the specified process on the specified host
Root @ kdjie-desktop:/etc # rpcinfo-P
Program version protocol port
100000 2 TCP 111 Portmapper
100000 2 UDP 111 Portmapper
100024 1 udp 56988 status
100024 1 tcp 44680 status
100021 1 udp 57561 nlockmgr
100021 3 UDP 57561 nlockmgr
100021 4 UDP 57561 nlockmgr
100021 1 tcp 44325 nlockmgr
100021 3 TCP 44325 nlockmgr
100021 4 TCP 44325 nlockmgr
100003 2 UDP 2049 NFS
100003 3 UDP 2049 NFS
100003 4 UDP 2049 NFS
100003 2 TCP 2049 NFS
100003 3 TCP 2049 NFS
100003 4 TCP 2049 NFS
100005 1 udp 53427 mountd
100005 1 tcp 46110 mountd
100005 2 UDP 53427 mountd
100005 2 TCP 46110 mountd
100005 3 UDP 53427 mountd
100005 3 TCP 46110 mountd
Root @ kdjie-desktop:/etc # rpcinfo-u 192.168.9.9 NFS
Program version 100003 2 is ready and waiting
Program version 100003 3 is ready and waiting
The program version 100003 is ready and waiting