Linux different server directory mapping

Assume that the machine where the source directory to be mapped is located is PC1:192.168.1.102

The machine that needs to be mapped is PC2: 192.168.1.105

PC1 requires:

1. Start the NFS service ( /etc/init.d/nfs start  )

2. Add mapping permissions (mapped directories and allowable addresses) in the /etc/exports file:

  / home / dir 192.168.1.0/255.255.255.0(rw,insecure,sync,insecure_locks,no_root_squash)

PC2 requires:

1.mkdir /home/dir_remote

2.mount 192.168.1.102:/home/dir /home/dir_remote

In this way, opening /home/dir_remote on PC2 is actually accessing the /home/dir directory of PC1.

Notice:

1. The corresponding port of PC1 needs to be released to ensure that there is no firewall blocking

2. When there is a problem, you can use rpcinfo -p server to check the status of each port to ensure that the nfs service is started

3. The root directory of the disk cannot be mapped

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326502888&siteId=291194637