192.168.0.10 centos7.9服务器端配置共享服务
192.168.0.11 centos7.9客户端访问共享数据
192.168.0.10配置nfs共享服务
# yum install nfs-utils rpcbind -y
#创建共享目录
# mkdir /opt/share
配置共享文件并授权
# vim /etc/exports
共享192.168.10.0整个网段
/opt/share 192.168.10.0/24(rw,sync,no_root_squash,no_all_squash)
或者
共享192.168.10.0单台服务器
/opt/share 192.168.10.11/24(rw,sync,no_root_squash,no_all_squash)
#chmod -R 777 /opt/share
#touch /opt/share/hello
重启服务
#systemctl restart nfs
192.168.0.11挂载共享服务
# yum install nfs-utils rpcbind -y
# mkdir /opt/test
# mount -t nfs 192.168.10.10:/opt/share /opt/test/