NFS服务

一、实验拓扑

                  

----------------RHEL6.5服务器----(vmnet1)----RHEL6.55客户端----------- 


RHEL6.5服务器:192.168.4.5/24

RHEL6.55客户端:192.168.4.205/24


实验一:

将/root 共享给192.168.4.205,可写、同步,允许客户机以root权限访问

NFS服务端操作:

[root@ser5 ~]# cat /etc/exports                  //查看nfs共享配置文件

/root   192.168.4.205(rw,sync,no_root_squash)

[root@ser5 ~]# service rpcbind restart           //重启rpc服务

[root@ser5 ~]# service nfs restart               //重启nfs服务

[root@ser5 ~]# chkconfig rpcbind on           //开机启动rpc

[root@ser5 ~]# chkconfig nfs on               //开机启动nfs

NFS客户端操作:

[root@pc205 ~]# service rpcbind restart         //重启rpc服务

[root@pc205 ~]# showmount -e 192.168.4.5   //查看远程共享

Export list for 192.168.4.5:

/root    192.168.4.205

[root@pc205 ~]# mkdir -p /data/root/            //新建文件夹

[root@pc205 ~]# mount 192.168.4.5:/root/ /data/root/       //挂载共享文件夹

[root@pc205 ~]# df -hT | grep nfs                         //查看挂载结果

               nfs     19G  2.7G   16G  15% /data/root

[root@pc205 ~]# cd /data/root/                          //进入目录

[root@pc205 ~]# touch  /data/root/test1.txt        //创建测试文件

[root@pc205 root]# ls -l/data/root/test1.txt       //查看测试结果

-rw-r--r-- 1 root root 0 06-12 17:18 test1.txt





你可能感兴趣的:(服务器,客户端,客户机)