1. Installation of nfs-utils and Rpcbind programs
Yum install-y nfs-utils Rpcbind
2. Edit Exports
Vim/etc/exports
/mnt 10.10.13.248 (Rw,sync)
3. Install Nfs-utils on the client and view shared information
[email protected] ~]# Yum install-y nfs-utils
[Email protected] ~]# showmount-e 10.10.13.247
return results
Export list for 10.10.13.247:
/mnt 10.10.13.248
4. Mount on Client
[Email protected] ~]# mount-t NFS 10.10.13.247:/mnt/opt
5. Change permissions for shared directories on the server side
[Email protected] ~]# chmod 777/mnt
6. Create a file on the client
Cd/opt
Vim 1.txt
Successfully created
7. Restrict users ' permissions to shared folders
Edit the configuration file on the server side
Vim/etc/exports
Revision changed to
/mnt 10.10.13.248 (rw,sync,all_squash,anonuid=502,anongid=502)
Reload the configuration file on the server after modification
Exportfs-arv or restart service-side NFS Service
Reload after the client unloads the disk to view shared file permissions
[Email protected] opt]# Umount 10.10.13.247:/mnt
Mount-t nfs-onolock,nfsvers=3 10.10.13.247:/mnt/opt
[Email protected] opt]# cd/opt
[Email protected] opt]# ls-l
You can see that the created file belongs to the main group and becomes river
-rw-r--r--. 1 River 6 May 11:10 3.txt
8, do not limit the root sharing permissions
Service-side edit config file changed to
/mnt 10.10.13.248 (Rw,sync,no_root_squash)
Reload the configuration file Exportfs-arv
After the client unloads the disk and reloads the file, it can be found that the file belongs to the master group and becomes root.
-rw-r--r--. 1 root root 7 May 11:23 4.tx
This article is from the "愺 Burgundy pounding his 豩" blog, please be sure to keep this source http://riverxyz.blog.51cto.com/533303/1784734
NFS Deployment and optimization