Ubuntu 16.04 nfs service setup, ubuntu16.04
The nfs service implements file sharing between Linux and Linux. The establishment of the nfs service is relatively simple.
Now we will introduce how to set up the nfs service in ubuntu16.04. ubuntu is easier to build than RedHat.
1. Install the nfs service
sudo apt install nfs-common
2. modify the configuration file
sudo vim /etc/exports
The modification content is as follows:
/home *(rw,sync,no_root_squash)
The meanings of each section are as follows and modified based on actual conditions.
/Home: shared directory *: specifies which users can access * All users who can ping the host 192.168.1. * specify the CIDR block. In This CIDR Block, users can mount 192.168.1.12. Only this user can mount (ro, sync, no_root_squash): Permission ro: Read-Only rw: read/write sync: Synchronous no_root_squash: do not lower the permissions of the root user. view other options man 5 exports
3. Restart the nfs service.
sudo /etc/init.d/nfs-kernel-server restart
At this point, the nfs service has been set up.
The following describes how the client accesses the server.
1. Check whether the network between the client and the server is connected (ping Command)
Ping + Host IP
2. view the shared directory of the server
Showmount-e + Host IP
showmount -e 192.168.1.93Export list for 192.168.1.93:/home *
3. Mount the directory to the local device.
mount 192.168.1.93:/home /mnt
4. Access
Access the local mnt directory to access the shared directory on the server.