linux共享文件夹

服务器1:192.168.1.1
服务器2:192.168.1.2  

192.168.1.1

ssh root@192.168.1.1   password  123456  

关闭防火墙

service iptables stop

 

$yum -y install nfs
$vi /etc/exports
--编辑 此内网网段对/home/share均可读写
/home/share 192.168.1.*/24(rw,sync) -- rw代表 读写   可以用 *(rw,sync)代表任何客户端都可以访问
----保存
$chmod -R 775 /home   --权限
$service rpcbind start  --不知道干啥的
$service nfs start  --开启nfs服务
$chkconfig nfs on  --不知道干啥的
$chkconfig rpcbind on --不知道干啥的

 

192.168.1.2

$yum -y install nfs

$service rpcbind start  --不知道干啥的

$service nfs start  --开启nfs服务
$chkconfig nfs on  --不知道干啥的
$chkconfig rpcbind on --不知道干啥的

 

$mkdir /home/share

$mount 0t nfs 192.168.1.1:/home/share /home/share   --ip一定要是上边开启服务的   :不能缺少  前边的/home/share  是exports里配置的路径   后边的/home/share 是当前的自己新建的文件夹。挂载成功之后,.1服务器上操作了文件夹,.2上就会出现操作的内容了。

$df -h

 

posted on 2019-05-08 14:34 smile_elims 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/liangbo-/p/10831698.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值