NFS的服务端:10.0.0.42
1、安装NFS: yum -y install nfs-utils rpcbind
2、添加配置文件:
/data 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash)
/data: 共享目录位置。 10.0.0.0/24: 客户端 IP 范围,* 代表所有,即没有限制。 rw: 权限设置,可读可写。 sync: 同步共享目录。 no_root_squash: 可以使用 root 授权。 no_all_squash: 可以使用普通用户授权
3、创建共享的目录:
4、添加开机自启和重启:nfs-server
systemctl enable rpcbind
systemctl enable nfs-server
systemctl restart rpcbind
systemctl restart nfs-server