Ubuntu 下NFS安装配置


1、
1)安装nfs服务户端
sudo apt-get install nfs-kernel-server
2)安装nfs客户端
sudo apt-get install nfs-common

2、配置共享目录
mkdir /home/song/nfs 建立一个nfs服务的专有的文件夹,这里路径依自己喜好而定!不过要记得这个路径

sudo vim /etc/exports 配置nfs
在文章的最后一行添加:/home/song/nfs *(rw,sync,no_root_squash,no_subtree_check)
或:/home/song/nfs 10.160.23.20(rw,sync,no_root_squash)
第一个参数是你要让客户机访问的目录,第二个是你允许的主机IP,最后的()内是访问控制方式。

3、
sudo /etc/init.d/portmap restart 重启portmap服务。
sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务。

4、挂载命令

mount  10.160.23.20:/home/song/nfs  /mnt/nfs

参考:

http://www.linuxidc.com/Linux/2013-08/89154.htm

http://blog.chinaunix.net/uid-15014334-id-2856425.html

http://www.cnblogs.com/mchina/archive/2013/01/03/2840040.html

http://jingyan.baidu.com/album/4f34706ec8ac6be387b56d1e.html?picindex=1

http://www.cnblogs.com/andriod-html5/archive/2012/05/07/2539224.html

猜你喜欢

转载自taobeibei.iteye.com/blog/2288639