nfs配置

时间:2019-06-28 19:39:29   收藏:0   阅读:148

1:服务器端:

[root@languang ~]# mkdir /nfsfile
[root@languang ~]# chmod 777 /nfsfile/
[root@languang ~]# echo "welcome to nfs" > /nfsfile/readme.txt

[root@languang ~]# vim /etc/nfs.conf(加上以下内容)

  /nfsfile 192.168.0.*(rw,sync,root_squash)


[root@languang ~]# firewall-cmd --permanent --add-service=nfs
success
[root@languang ~]# firewall-cmd --permanent --add-service=mountd
success
[root@languang ~]# firewall-cmd --permanent --add-service=rpc-bind
success
[root@languang ~]# systemctl restart firewalld.service

[root@languang ~]# systemctl restart rpcbind.socket
[root@languang ~]# systemctl enable rpcbind.socket
[root@languang ~]# systemctl restart nfs-server
[root@languang ~]# systemctl enable nfs-server
完成!

2:客户端

[root@www ~]# showmount -e 192.168.0.66

Export list for 192.168.0.66:

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!