本文共 837 字,大约阅读时间需要 2 分钟。
一、服务器配置:
yum -y install nfs-utils rpcbind
vim /etc/exports #添加/home/lee/nfs 192.168.8.*(rw,async,no_root_squash)
chmod -R a+w /home/lee/nfs
systemctl start rpcbindsystemctl start nfs
#rpcbind的端口iptables -I INPUT -p udp --dport 111 -j ACCEPTiptables -I INPUT -p tcp --dport 111 -j ACCEPT#nfs的端口iptables -I INPUT -p udp --dport 2049 -j ACCEPTiptables -I INPUT -p tcp --dport 2049 -j ACCEPT
二、客户端配置:
yum -y install rpcbind
showmount -e 192.168.8.81
mount 192.168.8.81:/home/lee/nfs /home/lee/nfs
b. 开机自动挂载:
echo "192.168.8.81:/home/lee/nfs /home/lee/nfs nfs defaults 0 0" >> /etc/fstab
三、测试:
touch /home/lee/nfs/test.txt
ll /home/lee