First, configure NFS sharing
Network File system
--Purpose: To provide the client with shared folders
--Protocol: NFS (TCP/UDP 2049) RPC (TCP/UDP 111)
Required Packages: Nfs-utils
System Services: Nfs-server
Building basic read-only NFS services
1. On the virtual machine Server0, detect if the nfs-utils is installed
[Email protected]/]# rpm-q nfs-utils
2. Modify the configuration file/etc/exports
[Email protected]/]# Mkdir/public
[Email protected]/]# echo Hehelele >/public/nsd.txt
[Email protected]/]# Vim/etc/exports
/public 172.25.0.0/24 (RO)
3. Restart Nfs-server service, set boot from
[Email protected]/]# systemctl restart Nfs-server
[Email protected]/]# Systemctl enable Nfs-server
4. Client access to the Nfs-server service
[Email protected]/]# Mkdir/mnt/nfs
[Email protected]/]# showmount-e 172.25.0.11
[Email protected]/]# Vim/etc/fstab
172.25.0.11:/public/mnt/nfs NFS _netdev 0 0
[Email protected]/]# mount-a
[Email protected]/]# Ls/mnt/nfs
###############################
If you need to read and write, you need to modify the configuration file on the server
Service side:
[Email protected]/]# Vim/etc/exports
/ABC 172.25.0.0/24 (Rw,no_root_squash) #不压榨客户端root权限
[Email protected]/]# systemctl restart Nfs-server
Normal User:
Client access to the service-side Nfs-server service,
The server will determine the permissions of the local user with the same UID as the client.
#################################################
LDAP: Network user, providing user name
Kerberos: Password authentication, implementation of "One-time password authentication, multiple free login" pass mechanism
NFS file sharing for Linux