
按照這兩個指南安裝 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 *
怎麼了?