配置NFS服务

徘徊边缘 提交于 2019-12-26 17:02:39

配置NFS服务

服务端 ip :192.168.1.10
客户端 ip :192.168.1.227
(服务端与客户端均须关闭防火墙、降低沙盒)

服务端配置

用 yum 安装 nfs 以及rpcbind
[root@bogon ~]# yum -y install nfs-utils rpcbind
编辑配置文件客户端访问,内容如下图
[root@bogon ~]# vim /etc/exports

在这里插入图片描述
创建目录 /home/xyl ,并赋予其权限
[root@bogon ~]# mkdir /home/xyl
[root@bogon ~]# chmod 777 /home/xyl/

按如下顺序开启服务
[root@bogon ~]# systemctl start rpcbind
关闭防火墙
[root@bogon ~]# systemctl start nfs
[root@bogon ~]# systemctl stop firewalld

降低沙盒
[root@bogon ~]# getenforce
Enforcing
[root@bogon ~]# setenforce 0
[root@bogon ~]# getenforce

Permissive
查看是否能 ping 通客户端
[root@bogon ~]# ping 192.168.1.227
在这里插入图片描述

客户端配置

用 yum 安装 nfs以及rpcbind
[root@localhost ~]# yum -y install nfs-utils rpcbind
按如下顺序开启服务
[root@localhost ~]# systemctl start rpcbind
[root@localhost ~]# systemctl start nfs

检查是否能 ping 通服务端
[root@localhost ~]# ping 192.168.1.10
在这里插入图片描述
连接服务端
[root@localhost ~]# showmount -e 192.168.1.10
关闭防火墙
[root@localhost ~]# systemctl stop firewalld
降低沙盒
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce

Permissive
将服务端 /home/xyl 挂载到客户端 /mnt
[root@localhost ~]# mount -t nfs 192.168.1.10:/home/xyl /mnt
查看挂载情况
[root@localhost ~]# df -h
在这里插入图片描述

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!