# yum -y install nfs-utils rpcbind
# 开启服务
service rpcbind start
service rpcbind start
# 配置
nano /etc/exports
# 配置文件内容
/home/filesrv 10.1.8.*(rw,sync)
# 配置生效
exportfs -r
# 检查
showmount -e
# 共享文件夹的权限
chmod 777 /home/filesrv
# 所用到的端口
rpcinfo -p
# 添加允许端口到iptables或关闭iptables
# 重要 此服务器不暴露在公网时或只能通过内网IP访问时这样做,否则不建议这样做。
iptables -A INPUT -p tcp --dport 111 -j ACCEPT
iptables -A INPUT -p udp --dport 111 -j ACCEPT
........
# 检查服务端共享情况
showmount -e 10.1.8.25
# 挂载共享文件夹到本机
mount -t nfs 10.1.8.25:/home/filesrv /home/fileapp