Configure NFS sharing to share files between linux and linux. nfslinux
Configure NFS sharing to share files between linux and linux.
This article uses two virtual machines to simulate
Use one of them as the client and one as the service machine
The configuration of the server is divided into three steps:
1. Install software nfs-utils
[Root @ server0 ~] # Yum install nfs-utils
2. determine the path of the shared file and modify the configuration file/etc/exports.
Write the following code into the configuration file:
/Public? * (Ro)
[Note:/public indicates the folder to be shared * indicates that all clients on the server can be pinged, and (ro) indicates that the connected client only performs read operations on/public files.]
3. Restart the Software Service
Systemctl restart nfs-server
Configure the client
1. Enable automatic mounting
The configuration file to be changed is/etc/fstab (Note: This configuration file is a file about enabling the computer. It cannot be changed or written incorrectly)
172.25.0.11:/public/mnt/nfs ults, _ netdev 0 0
[Root @ override top0/] # vim/etc/fstab
To verify that the configuration file is correct, verify the following code:
[Root @ override top0/] # mount-? Verify whether the mounting is successful
[Root @ brief top0/] # df-h display mounting information
[Root @ brief top0/] # ls/mnt/nfs view access point content