Linux(Centos)服务器间共享文件夹

如: 将 /192.168.1.171/root/share/ 共享,挂载到 192.168.1.172 的目录/root/share/ 


安装 nfs:

yum -y install nfs-utils rpcbind

chkconfig rpcbind on
chkconfig nfs on

service rpcbind start
service nfs start
192.168.1.171 的配置:
#192.168.1.171 配置
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --reload

mkdir -p /root/share
chmod 777 /root/share
echo '/root/share/ 192.168.1.172(rw,insecure,sync,all_squash)'>>/etc/exports

exportfs -r
exportfs

#查看
showmount -e
showmount -e 192.168.1.171
192.168.1.172 的配置:
#192.168.1.172 配置
mkdir -p /root/share
mount -t nfs 192.168.1.171:/root/share/ /root/share/

#查看
showmount -e 192.168.1.171


参考:

18.7. The /etc/exports Configuration File

NFS /etc/export配置


猜你喜欢

转载自blog.csdn.net/kk185800961/article/details/80381208
今日推荐