码迷,mamicode.com
首页 > 其他好文 > 详细

nfs服务

时间:2014-08-03 22:57:26      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   文件   数据   art   

1.安装 nfs 服务
yum install nfs-utils rpcbind
chkconfig nfs on

2.exprotfs 文件
/usr/sbin/exportfs -rv
cat /etc/exports
/home/  10.0.2.0/24(rw,sync,all_squash,anonuid=501,anongid=501)
rw :读写;
ro :只读;
sync :同步模式,内存中数据时时写入磁盘;
async :不同步,把内存中数据定期写入磁盘中;
no_root_squash :加上这个选项后,root用户就会对共享的目录拥有至高的权限控制,就像是对本机的目录操作一样。不安全,不建议使用;
root_squash :和上面的选项对应,root用户对共享目录的权限不高,只有普通用户的权限,即限制了root;
all_squash :不管使用NFS的用户是谁,他的身份都会被限定成为一个指定的普通用户身份;
anonuid/anongid :要和root_squash 以及 all_squash一同使用,用于指定使用NFS的用户限定后的uid和gid,前提是本机的/etc/passwd中存在这个uid和gid。
介绍了上面的相关的权限选项后,再来分析一下笔者刚刚配置的那个/etc/exports文件。其中要共享的目录为/home,信任的主机为10.0.2.0/24这个网段,权限为读写,同步,限定所有使用者,并且限定的uid和gid都为501。

3.启动nfs 服务
旧版本
service portmap start
service nfs start
/etc/init.d/portmap restart
/etc/rc.d/init.d/nfs restart
新版本
/etc/init.d/rpcbind start
/etc/init.d/nfs start
    
4.mount
mount -t nfs 10.0.2.69:/home /mnt
5.umount
umount -l /gome_guest/jsp/Gome
 

nfs服务,布布扣,bubuko.com

nfs服务

标签:style   blog   http   color   使用   文件   数据   art   

原文地址:http://www.cnblogs.com/xiewenhui/p/3888860.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!