按照这两个指南安装 NFS 服务器和客户端:
- https://www.howtoforge.com/nfs-server-and-client-on-centos-7
- https://www.howtoforge.com/tutorial/setting-up-an-nfs-server-and-client-on-centos-7/
主办方:
- 服务器:192.168.1.1
- 客户端:192.168.1.2
服务器
/etc/exports
服务器上的配置:
[root@server ~]# cat /etc/exports
/var/nfsshare *(rw,sync,no_root_squash,no_all_squash)
/home *(rw,sync,no_root_squash,no_all_squash)
/var/nfs *(rw,sync,no_root_squash,no_all_squash)
跑步:
[root@server ~]# exportfs -a
客户
然后尝试从客户端挂载服务器,出现错误:
[root@client ~]# mount -t nfs 192.168.1.1:/home /mnt/nfs/home/
mount.nfs: access denied by server while mounting 192.168.1.1:/home
但是,我可以从客户端看到挂载信息:
[root@client ~]# showmount -e 192.168.1.1
Export list for 192.168.1.1:
/var/nfs *
/home *
/var/nfsshare *
怎么了?