练习要求:
搭建一个nfs服务器,客户端可以从该服务器的/share目录上传并下载文件
操作步骤:
服务端:
1.创建共享目录
[root@localhost ~]# mkdir -p /share
2.编辑配置文件
[root@localhost ~]# vim /etc/exports
3.更改share权限,关闭防火墙
[root@localhost ~]# chmod o=rwx /share/ #更改share权限
[root@localhost ~]# systemctl status firewalld --now #关闭防火墙
4.更改getenforce状态
[root@localhost ~]# getenforce #查看状态
Enforcing
[root@localhost ~]# setenforce 0 #更改状态
[root@localhost ~]# getenforce
Permissive
5.重启nfs服务
[root@localhost ~]# systemctl restart nfs-server.service
6.进行访问验证
[root@localhost ~]# showmount -e 192.168.234.151
客户端:
1.创建目录
[root@localhost ~]# mkdir /xx1 #创建目录
[root@localhost ~]# mount 192.168.234.151:/share /xx1 #挂载
2.挂载并检查是否成功
[root@localhost ~]# df -h