Ubuntu配置NFS

浏览:
字体:
发布时间:2013-12-09 23:23:33
来源:

1.部署NFS Server端

1.1安装nfs-kernel-server

sudo apt-get install nfs-kernel-server

1.2配置/etc/hosts.deny

vi /etc/hosts.deny

#在文件中增加内容

###NFSDAEMONS

portmap:ALL

lockd:ALL

mountd:ALL

rquotad:ALL

statd:ALL

1.3配置/etc/hosts.allow

vi /etc/hosts.allow

#在文件中增加内容

###NFSDAEMONS

portmap:客户端IP

lockd:客户端IP

rquotad:客户端IP

mountd:客户端IP

statd:客户端IP

1.4重启portmap deamon

/etc/init.d/portmap restart

1.5配置/etc/exports

若将192.168.71.205的/home目录共享给192.168.71.46,在/etc/exports文件中添加

/home 192.168.71.46(rw,sync,no_root_squash)

说明:

(1)rw是读写权限,只读为ro;

(2)sync数据同步写入内存和硬盘,async数据会先暂存在内存,而不立即写入硬盘;

(3)no_root_squash服务器共享目录用户的属性,如果用户是root,那么对于这个共享目录来说就具有root的权限

1.6重启NFS服务

/etc/init.d/nfs-kernel-serverrestart

2.部署NFS client端

2.1安装nfs-common

sudo apt-get install nfs-common

2.2挂载NFS

如:将192.168.71.205 NFS服务端的/home/挂载到192.168.71.46的NFS客户端上,在192.168.71.46机器上执行:

mount-t nfs -o tcp,soft,intr,timeo=50,retrans=12, 192.168.71.205:/home /home/testclient(这两个目录必须是两台机器上已存在的)。

2.3检查挂载是否成功

df

2.4卸载

unmount /home/testclient

>更多相关文章
24小时热门资讯
24小时回复排行
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();