1、关闭防火墙
#systemctl stop firewalld
2、安装nfs
#dnf search nfs
#dnf install nfd-utils.x86_64 -y
3、启用服务
#systemctl enable --now nfs-server
查看
#netstat -antlupe | grep rpc
4、共享目录
#mkdir /wang
#chmod 777 /wang
#vim /etc/exports
/wang *(rw,sync,no_root_squash)
#exports -rv
5、在客户端查看服务器主机发布的nfs共享文件夹
#showmount -e 172.25.254.100
6、在客户端安装autofs自动挂载服务
#dnf install auto-1:5.1.7-65.el9.x86_64 -y
7、在客户端自动挂载远端NFS共享
#vim /etc/auto.master
8、在客户端配置autofs自动把服务器的/wang目录只读挂载到本地/nfs/wang
#vim /etc/auto.wang
wang -ro 172.25.254.100:/wang
9、在客户端重启
#systemctl restart autofs
#systemctl enable autofs
10、在客户端测试





