NFS运维二班--梁瑞

首先创建两个虚拟机

一个设为服务端

一个设为客户端

2.服务端:

|---yum install  nfs*

|--yum list | grep nfs

查看端口

|--ss -tunmlp | grep nfs

|--cat /etc/services | grep nfs

|-- ss -tnmlp | grep 2049

查看服务器状态

|-- systemctl status nfs

 |-- ls /mnt/

 |--mkdir /mnt/share

 |-- vi /etc/exports

编辑文件

/mnt/share   192.168.1.0/24(rw)

w+q保存退出

启动服务

 |-- systemctl restart nfs

 |--systemctl status nfs

关闭防火墙  

|--iptables -F

|--iptables -x

|--iptables -X

 |--setenforce 0

 |-- cat /etc/passwd 000000

  |--ll /mnt/

给权限 

|--chown  -R 757 /mnt/share

|--chmod -R 757 /mnt/share

|--chown -R  root /mnt/share

|--ll /mnt/

|-- ls /mnt/

|--ls /mnt/share/

 |--  ss -tnmlp | grep nfs

 

客户端|

|--yum install nfs-utils

|--showmount --help

|--showmount -e 192.168.1.18

|--df -Th

|--mkdir /mnt/shareing
|--mount -t nfs 192.168.1.185:/mnt/share /mnt/shareing
|--df -Th


|--cd /mnt/shareing/
|--ll
|--cd ..
|--ll
|--cd shareing/
|--mkdir ss
|--ll

-------------------------------------------------------------------------

猜你喜欢

转载自www.cnblogs.com/liangopop123/p/9667123.html