配置并访问NFS共享

NFS服务器 192.168.2.5

NFS客户机 192.168.2.100

软件包nfs-utils用来提供NFS共享服务及相关工具,而软件包rpcbind用来提供RPC协议的支持

服务器

修改/etc/exports文件,添加共享目录设置

[root@proxy ~]# vim  /etc/exports
/root           192.168.2.100(rw,no_root_squash)
/usr/src        192.168.2.0/24(ro)

启动NFS共享相关服务,确认共享列表

[root@proxy ~]# systemctl restart rpcbind  ;  systemctl enable rpcbind
[root@proxy ~]# systemctl restart nfs ;  systemctl enable nfs  

从客户机访问NFS共享

1)查看服务器提供的NFS共享列表

[root@web1 ~]# showmount  -e  192.168.2.5

2)设置永久挂载

[root@web1 ~]# vim  /etc/fstab
.. ..
192.168.2.5:/usr/src  nfsdir         nfs  default,ro   0 0
192.168.2.5:/root     root5         nfs  default      0 0

猜你喜欢

转载自www.cnblogs.com/ray-mmss/p/10192645.html