理论篇
Linux系统之间做共享目录用
实践篇
两台Linux服务器,任何一个版本都行。
192.168.147.49服务端
192.168.147.42客户端
分别关闭两台服务器防火墙
service iptables stop
一般Linux系统自带该软件,检查是否安装成功
[root@www ~]# rpm -qa|grep nfs
nfs-utils-lib-1.0.8-7.9.el5
nfs-utils-1.0.9-71.el5_11
[root@www ~]# rpm -qa|grep portmap
portmap-4.0-65.2.2.1
如果没有:yum install –y nfs*
server端
[root@www ~]# vi /etc/exports
/root/key 192.168.147.0/24(rw)
[root@www ~]# chmod 777 -R /root/key
[root@www ~]# service portmap start
[root@www ~]# service nfs start
client端
[root@www ~]# mkdir /tmp/key
[root@www ~]# mount 192.168.147.49:/root/key /tmp/key/
[root@www ~]# cd /tmp/key/
[root@www key]# ls
ca.crtca.srlserver.crtserver.csrserver.keyserver.pem
服务重启方法:
# service nfs stop
# service portmap restart
# service nfs start
ps:
showmount -e//默认查看自己共享的服务,前提是要DNS能解析自己,不然容易报错
[root@www ~]# showmount -e
Export list for
/root/key 192.168.147.0/24
showmount -a//显示已经与客户端连接上的目录信息
[root@www ~]# showmount -a
All mount points on
192.168.147.42:/root/key
本人安装过程中遇到的问题
[root@www ~]# mount 192.168.147.49:/home/key /tmp/key/
mount: 192.168.147.49:/home/key failed, reason given by server: Permission denied
把路径看错了~`~