Chinaunix首页 | 论坛 | 博客
  • 博客访问: 297332
  • 博文数量: 87
  • 博客积分: 1206
  • 博客等级: 少尉
  • 技术积分: 725
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-16 00:12
个人简介

do the right things the right ways

文章分类

全部博文(87)

文章存档

2017年(5)

2016年(6)

2015年(1)

2012年(11)

2011年(64)

分类: LINUX

2012-08-06 17:08:11

安装APP:

yum install portmap 
yum install nfs-utils

配置/etc/exports

/home/user/Scripts 192.168.111.*(rw,async,no_root_squash)
/home/user/Scripts 192.168.0.*(rw,async,no_root_squash)

问题:

[root@CentOSSHVM ~]# exportfs -rv OR /etc/init.d/nfs restart
exportfs: No options for /home/user/Scripts 192.168.111.*: suggest 192.168.111.*(sync) to avoid warning
exportfs: No host name given with /home/user/Scripts (rw,async,no_root_squash), suggest *(rw,async,no_root_squash) to avoid warning
exporting 192.168.111.*:/home/user/Scripts
exporting *:/home/user/Scripts
[root@CentOSSHVM ~]# mount -t nfs 192.168.111.139:/home/user/Scripts /mnt/
mount.nfs: access denied by server while mounting 192.168.111.139:/home/owin/Scripts

可能是exports文件配置有问题,试着把括号前的空格去掉。
把防火墙关掉。

I googled and found that since the port is over 1024 I needed to add the "insecure" option to the relevant line in /etc/exports on the server. Once I did that (and ran exportfs -r), the mount -a on the client worked.

//如果端口号大于1024,则需要将 insecure 选项加入到配置文件(/etc/exports)相关选项中mount客户端才能正常工作:

查看 exports 手册中关于 secure 选项说明也发现确实如此

[root@lzgonline init.d]# man exports

secure,This  option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure.

//secure 选项要求mount客户端请求源端口小于1024(然而在使用 NAT 网络地址转换时端口一般总是大于1024的),默认情况下是开启这个选项的,如果要禁止这个选项,则使用 insecure 标识

修改配置文件/etc/exports,加入 insecure 选项

/home/lzgonline/rootfs  *(insecure,rw,async,no_root_squash)



阅读(1203) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~