环境拓扑
-------RHEL5.9_A----(vmnet1)----RHEL5.9_B-----------
RHEL5.9_A: 192.168.10.253/24
RHEL5.9_B: 192.168.10.20/24
NFS服务端操作:
[[email protected] ~]# rpm -qnfs-utils portmap //查看是否安装nfs服务
nfs-utils-1.0.9-66.el5
portmap-4.0-65.2.2.1
[[email protected] ~]# cat /etc/exports
/root 192.168.10.20(rw,sync,no_root_squash) //指定只有10.20可以访问root目录
/usr/src 192.168.20.0/24 (rw,sync,no_root_squash)//指定一个网段可以访问这个目录
注:rw读写、no_root_squash保留来自客户端的root权限、Sync同步、async异步
[[email protected] ~]# service portmap restart //开启服务
[[email protected] ~]# chkconfig portmap on
[[email protected] ~]# service nfs restart
[[email protected] ~]# chkconfig nfs on //开机自动加载
客户端操作:
[[email protected] ~]# service portmap start
[[email protected] ~]# showmount -e 192.168.10.253 //查看共享
Export list for 192.168.10.253:
/root 192.168.10.20
[[email protected] ~]# mkdir -p /data/root
[[email protected] ~]# mount 192.168.10.253:/root /data/root/ //挂载
[[email protected] ~]# cd /data/root //进入
[[email protected] root]# ll //验证