nfs权限
1:防火墙
2:vi etc/export的读写权限
3:selinux
4:系统权限
服务端
1.开启服务,设置下一次开机自动启动
systemctl start nfs-server
systemctl enable nfs-server
2.创建挂载目录并修改目录权限
mkdir /public
mkdir /protected
cd /protected/
mkdir restricted
3.添加用户并修改权限
useradd varuna
chown varuna /protected/restricted
chmod 777 /protected
4.修改配置文件
vim /etc/exports
通过Kerberos建立两台服务器之间的信任,只要依靠krb5.keytab
5.下载密钥
wget -O /etc/krb5.keytab http:xxx
6.修改nfs版本4.2
vim /etc/sysconfig/nfs
7.开启nfs-secure-server服务,重启nfs-server
systemctl status nfs-secure-server
systemctl start nfs-secure-server
systemctl enable nfs-secure-server
8.防火墙放行nfs服务
firewall-cmd --add-service=nfs --permanent
firewall-cmd --add-service=nfs
9.直接重启:systemctl restart nfs-server
客户端
1.创建挂载目录
mkdir /mnt/nfssecure/
mkdir /mnt/nfsmount/
2.下载密钥
wget -O /etc/krb5.keytab http://xxx.example.com/pub/keytabs/desktop0.keytab
3.开启nfs-secure服务
systemctl start nfs-secure
systemctl enable nfs-secure
4.修改挂载文件
vim /etc/fstab
5.mount -a 挂载
注:临时挂载命令
mount server0.example.com:/public /mnt/nfsmount/
mount server0.example.com:/protected /mnt/nfssecure/ -o vers=4.2,sec=krb5p