Introduction to NFS
NFS (Network File System) is a network file system, one of the file systems supported by FreeBSD, which allows computers on the network to share resources through a TCP/IP network. In NFS applications, local NFS client applications can transparently read and write files located on remote NFS servers, just like accessing local files.
The nfs service is to realize file sharing between Linux and Linux, and the construction of the nfs service is relatively simple.
Now introduce how to build nfs service in ubuntu16.04 system, ubuntu is easier to build than Red Hat.
How to configure NFS on Ubuntu
1、 Install nfs service
sudo apt install nfs-common
2、 Modify configuration file
sudo vim /etc/exports
The revised content is as follows:
/home *(rw,sync,no_root_squash)
The meaning of each paragraph is as follows, modified according to actual conditions
/home: shared directory
* : Specify which users can access
* All users who can ping the same host
192.168.1.* Specify a network segment, users in this network segment can mount
192.168.1.12 Only this user can mount(ro,sync,no_root_squash): Permission
ro :Read only
rw :Read and write
sync :Synchronize
no_root_squash:Does not reduce the permissions of the root user
Other options man 5 exports view
3、 Restart nfs service
sudo /etc/init.d/nfs-kernel-server restart
At this point, the nfs service is 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.93
Export list for192.168.1.93:/home *
3、 Mount the directory to the local
mount 192.168.1.93:/home /mnt
4、 access
Access the local mnt directory, you can access the server-side shared directory.
to sum up
The above is the entire content of this article. I hope that the content of this article has a certain reference value for your study or work. Thank you for your support to ZaLou.Cn. If you want to know more about it, please check the related links below
Recommended Posts