搭建NFS服务器
1.安装nfs-utils
[root@linux1 ~]
2.创建共享目录,修改目录权限为777
3.在配置文件/etc/exports 里写入需要共享的配置信息
[root@linux1 ~]
/nfsshare 192.168.100.*(rw,sync,root_squash)
4.重启 rpcbind 和 nfs 服务
[root@linux1 ~]
[root@linux1 ~]
(注意先后顺序,否则客户端报错如下)
[root@Linux2 ~]
clnt_create: RPC: Program not registered
在Linux客户端使用
1.用showmount命令查看远程主机NFS共享列表
[root@linux2 ~]
Export list for 192.168.10.10:
/nfsfile 192.168.10.*
2.创建挂载点然后挂载使用
[root@linux2 ~]
[root@linux2 ~]
3.写入/etc/fstab文件
[root@linux2 ~]
192.168.100.10:/nfsshare /nfsshare nfs defaults 0 0