服务管理 NFS

1、关闭防火墙(4步)
root@zhangwu ~]# systemctl stop  firewalld
[root@zhangwu ~]# systemctl disable firewalld
[root@zhangwu  ~]# vim /etc/selinux/config
[root@zhangwu ~]# setenforce 0
2、安装nfs服务(nfs-utils  rpcbind)
[root@zhangwu ~]# yum -y install  nfs-utils 
[root@zhangwu ~]# yum -y install  rpcbind
已加载插件:product-id, search-disabled-repos, subscription-manager
This system is 
3、启动nfs服务 和 rpcbind
[root@zhangwu ~]# systemctl start nfs-server
[root@zhangwu ~]# systemctl start rpcbind

4、编辑配置文件的共享目录
5、重启nfs服务
[root@zhangwu ~]# systemctl restart nfs-server rpcbind
6、创建共享目录
[root@zhangwu ~]# mkdir /chenqian
客户端:

1、关闭防火墙(4步
[root@add ~]# systemctl  stop  firewalld
[root@add ~]# systemctl  disable   firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@add ~]# systemctl  disable   firewalld
[root@add ~]# vim /etc/selinux/
config         final/         semanage.conf  targeted/      tmp/
[root@add ~]# vim /etc/selinux/
config         final/         semanage.conf  targeted/      tmp/
[root@add ~]# vim /etc/selinux/
config         final/         semanage.conf  targeted/      tmp/
[root@add ~]# vim /etc/selinux/config
2、搭建nfs服务
[root@add ~]# yum -y install nfs-utils rpcbind
已加载插件:product-id, search-disabled-repos, subscription-manager 
3、启动nfs服务
[root@add ~]# systemctl  start  nfs-server  rpcbind
4、验证nfs服务端的共享目录
[root@add ~]# showmount -e 192.168.50.137
Export list for 192.168.50.137:
/add  192.168.50.138
5、创建挂载的目录站点
[root@add ~]# mkdir /nfs
6、挂载
[root@add ~]# mount -t nfs 192.168.50.137:/add   /nfs
7、然后在服务端为共享目录设置匿名用户和组   
 [root@zhangwu ~]# chown  -R  nfsnobody.nfsnobody  /add  
 8、在客户端验证挂载目录站点是否可以创建文件和删除文件
 [root@add nfs]# touch  7   8
touch: 无法创建"7": 只读文件系统
touch: 无法创建"8": 只读文件系统
[root@add nfs]# touch 7  8
[root@add nfs]# ls
1  2  3   7   8
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值