Linux总结笔记7-配置NFS服务实现Linux间文件共享

搭建NFS服务器

1.安装nfs-utils

[root@linux1 ~]# yum -y install nfs-utils

2.创建共享目录,修改目录权限为777

3.在配置文件/etc/exports 里写入需要共享的配置信息

[root@linux1 ~]# vim /etc/exports
/nfsshare       192.168.100.*(rw,sync,root_squash)

4.重启 rpcbind 和 nfs 服务

[root@linux1 ~]# systemctl restart rpcbind
[root@linux1 ~]# systemctl restart nfs-server
(注意先后顺序,否则客户端报错如下)
[root@Linux2 ~]# showmount -e 192.168.100.10
clnt_create: RPC: Program not registered

在Linux客户端使用

1.用showmount命令查看远程主机NFS共享列表

[root@linux2 ~]# showmount -e 192.168.10.10 
Export list for 192.168.10.10: 
/nfsfile 192.168.10.*

2.创建挂载点然后挂载使用

[root@linux2 ~]# mkdir /nfsshare
[root@linux2 ~]# mount -t nfs 192.168.100.10:/nfsshare /nfsshare

3.写入/etc/fstab文件

[root@linux2 ~]# vim /etc/fstab
192.168.100.10:/nfsshare        /nfsshare       nfs     defaults    0 0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值