#(ro)只读,(rw)读写,(rw,no_root_squash)读写,root写入需要这个参数no_root_squash # /共享文件名 ip(ro只读,rw只写 anonuid=用户id号,不是root,是id号0{anongid=0})no_root_squash不需要属组属主 mkdir /root/eee #创建public共享目录 vi /etc/exports #编辑 /root/eee 192.168.245.0/24 (rw) #前面目录 ip端 权限 systemctl reload nfs #重新加载NFS服务,使配置文件生效 启动查看 #启动服务和设置开启启动 systemctl restart rpcbind #先启动rpc服务 systemctl enable rpcbind #设置开机启动 systemctl restart nfs-server #reload也可以 systemctl enable nfs-server systemctl status rpcbind.service systemctl status nfs-server.service showmount -e 192.168.216.164 #查看挂载信息本机ip exportfs -v #确认共享生效
|