手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

RHCE_RHEL6_实战精品 4.nfs服务器

[日期:2012-08-17] 来源:Linux社区  作者:Linux [字体:大 中 小]

企业需求:

配置nfs服务器,将/common目录共享给dn.ws.com域,并允许客户端以root用户访问时,也拥有root用户权限。

实施步骤:

1.检查nfs服务。保证正常。

[root@dtop30 ~]# rpm -qa |grep nfs

RHCE_RHEL6_实战精品 4.nfs服务器

已经安装了。如果没有安装,即安装之。

[root@dtop30 ~]# chkconfig nfs on

[root@dtop30 ~]# service nfs start

2.创建目录/common,所有人可读、写、执行。

[root@dtop30 ~]# mkdir /common

[root@dtop30 ~]# chmod 777 /common

3.编辑/etc/exports,这个文件最初是空的。

[root@dtop30 ~]# vim /etc/exports

/common     *.dn.ws.com(rw,sync)       注意()是紧挨着的,没有空格

[root@dtop30 ~]# service nfs restart

[root@dtop30 ~]# showmount -e localhost

RHCE_RHEL6_实战精品 4.nfs服务器
RHCE_RHEL6_实战精品 4.nfs服务器

4.挂载测试:

[root@dtop30 ~]# mount -t nfs 172.24.30.30:/common/ /mnt

[root@dtop30 ~]# mkdir /mnt/nfs.txt

[root@dtop30 ~]# ls -l /mnt/

RHCE_RHEL6_实战精品 4.nfs服务器

5.以root用户访问时,也拥有root用户权限。

[root@dtop30 ~]# umount /mnt

[root@dtop30 ~]# vim /etc/exports

/common     *.dn.ws.com(rw,no_root_squash,sync)   注意:这里加上了“no_root_squash”

[root@dtop30 ~]# service nfs reload

[root@dtop30 ~]# exportfs -v

RHCE_RHEL6_实战精品 4.nfs服务器

6.重新挂载测试:

[root@dtop30 ~]# mount -t nfs 172.24.30.30:/common/ /mnt/

[root@dtop30 ~]# mkdir /mnt/

[root@dtop30 ~]# ls -l /mnt/nfs_root

RHCE_RHEL6_实战精品 4.nfs服务器
linux
相关资讯      
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款