目录
1 客户端和服务端安装rpcbind、nfs-utils (提前写yum源、挂载光盘)
2 服务端和客户端均关掉防火墙、 设置selinux、启动rpc 、nfs
3.1.2 服务器编辑 /etc/exports供所有用户查询
3.2 开放/nfs/upload目录,供所有用户上传下载资料
3.2.4客户端将服务器端的开放目录挂载到自己的目录上,同时也可以查看到开放目录里面内容。
1 客户端和服务端安装rpcbind、nfs-utils (提前写yum源、挂载光盘)
[root@client ~]# yum install rpcbind -y
[root@client ~]# yum install nfs-utils -y
2 服务端和客户端均关掉防火墙、 设置selinux、启动rpc 、nfs
[root@client ~]# systemctl stop firewalld.service
[root@client ~]# getenforce
Enforcing
[root@client ~]# setenforce 0
[root@client ~]# systemctl start rpcbind
[root@client ~]# systemctl start nfs-server
3.1 开放/nfs/shared目录,供所有用户查询资料
3.1.1 服务器创建/nfs/shared目录
[root@server ~]# mkdir nfs
[root@server ~]# cd nfs
[root@server nfs]# mkdir shared
3.1.2 服务器编辑 /etc/exports供所有用户查询
[root@server nfs]# vim /etc/exports
3.1.3 服务器重启nfs
[root@server nfs]# systemctl restart nfs-server
3.1.4 客户端创建/client/shuju
[root@client ~]# mkdir client
[root@client ~]# cd client
[root@client client]# mkdir shuju
3.1.5检测是否可以showmount
(1)服务器自我检测
[root@server nfs]# showmount -e 192.168.102.131
———————— 成功截图
(2)客户端尝试showmount
[root@client ~]# showmount -e 192.168.102.131
———————— 成功截图
3.1.6 客户端挂载
[root@client client]# mount 192.168.102.131:/nfs/shared /client/shuju
——————挂载成功
3.1.7服务器端在/nfs/shared添加内容,客户端可以在/client/shuju下看到。
(1)服务器添加内容
(2)客户端查看(可以看到其他人权限: r-- )
3.2 开放/nfs/upload目录,供所有用户上传下载资料
3.2.1服务器创建新的目录
[root@server nfs]# mkdir upload
[root@server nfs]# cd upload
3.2.2服务器编辑etc/exports
3.2.3服务器和客户端showmount
(1)服务器端
(2)客户端