mount.nfs: access denied by server while mounting

问题及截图?

客户端挂载nfs共享目录的时候提示如下:

mount.nfs: access denied by server while mounting 192.168.44.10:/xxx

问题原因有两方面:

一:权限问题

服务器端的共享目录没有给足相应的权限导致,导致挂载失败

解决办法:在服务器端修改共享目录的权限或者直接给777权限测试,成功连接。

二:权限已经给到位了但是还是不能挂载上

问题描述:其实文件夹权限都设为777了,权限上都没问题,hosts.deny和hosts.allow都保留默认设置,防火墙也关了,该设置的都设置了,但还是被拒绝。

首先使用命令查看出错日志文件
cat /var/log/messages |grep mount 

 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@server]# 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 选项

 然后重启nfs服务:service nfs restart  | systemctl restart nfs

--------------------------问题成功解决了--------------------------

猜你喜欢

转载自blog.csdn.net/weixin_44657888/article/details/131330634