挂载一个NFS共享

在 system2 上挂载一个来自 system1.group8.example.com 的NFS共享,并符合下列要求:linux

一、/public 挂载在下面的目录上 /mnt/nfsmountvim

二、/protected挂载在下面的目录上 /mnt/nfssecure 并使用安全的方式,密钥下载URL以下:http://server.group8.example.com/pub/keytabs/system2.keytab安全

三、用户 andres 可以在 /mnt/nfssecure/project 上建立文件ide

四、这些文件系统在系统启动时自动挂载测试

答:spa

在 sytem2 上执行3d

一、创建挂载点code

mkdir /mnt/nfsmount /mnt/nfssecure

二、下载 kerberos 证书server

wget -O /etc/krb5.keytab http://server.group8.example.com/pub/keytabs/system2.keytab

三、再 fstab 文件中添加持久化挂载选项blog

vim /etc/fstab

system1:/public /mnt/nfsmout nfs defaults,sec=sys 0 0
system1:/protecetd /mnt/nfssecure nfs defaults,sec=krb5p,v4.2 0 0

四、设定服务开机启动而且立刻运行服务(因为用到了kerberos验证,因此须要启动该服务)

systemctl enable nfs-secure
systemctl start nfs-secure.service

五、测试

# 挂载
mount -a

# 查看挂载
df -h

...
system1:/public 9.8G 3.2G 6.7G 32% /mnt/nfsmount
system1:/protected 9.8G 3.2G 6.7G 32% /mnt/nfssecure
# 登陆andres
su - andres

kinit
Password for andres@GROUP8.EXAMPLE.COM: redhat

cd /mnt/nfssecure/project/

touch testfile

# 查看建立信息,若是存在表示成功
ls -l
若是写入文件失败,检查system1是否修改了nfs启动参数为"-V 4.2"并对目录设定了正确的 selinux 上下文,在检查 system2 是否正确挂载参数 "v4.2"
相关文章
相关标签/搜索