NFS文件共享服务
——白·月
NFS服务器ip:192.168.1.10
客户端ip:192.168.1.20
[root@localhost ~]# mkdir /baiyue \\创建共享文件夹
[root@localhost ~]# vim /etc/exports \\编辑nfs的配置文件
/baiyue 192.168.1.0/24(sync,no_root_squash,rw)
[root@localhost ~]# chmod 777 /baiyue \\给共享文件夹777的权限
[root@localhost ~]# cd /
[root@localhost /]# ll
total 28
-rw-r--r--. 1 root root 0 Jul 9 04:04 1
drwxrwxrwx. 2 root root 6 Aug 24 22:45 baiyue
[root@localhost /]# systemctl start nfs \\启动nfs服务器
[root@localhost /]# showmount -e
Export list for localhost.localdomain:
/baiyue 192.168.1.0/24
客户端:
[root@localhost ~]# showmount -e 192.168.1.10
Export list for 192.168.1.10:
/baiyue 192.168.1.0/24
[root@localhost ~]# mkdir /baiyue \\客户端里创建共享文件夹
[root@localhost ~]# mount -t nfs 192.168.1.10:/baiyue /baiyue \\挂载
[root@localhost ~]# cd /baiyue/
[root@localhost baiyue]# touch a \\验证
[root@localhost baiyue]# ls
a
Nfs:
[root@localhost /]# cd baiyue/
[root@localhost baiyue]# ls
a
[root@localhost baiyue]# touch b
[root@localhost baiyue]# ls
a b
客户端:
[root@localhost baiyue]# ls
a b