无法写入挂载点(nfs-server),获得“权限被拒绝”

无法写入挂载点(nfs-server),获得“权限被拒绝”,第1张

概述我正在尝试在两个RHEL7节点之间配置NFS: 第一个节点: [root@ip-10-164-175-246 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.0 (Maipo)[root@ip-10-164-175-246 ~]# rpm -q nfs-utilsnfs-utils-1.3.0-0.e 我正在尝试在两个RHEL7节点之间配置NFS:

第一个节点:

[root@ip-10-164-175-246 ~]# cat /etc/redhat-release Red Hat Enterprise linux Server release 7.0 (Maipo)[root@ip-10-164-175-246 ~]# rpm -q nfs-utilsnfs-utils-1.3.0-0.el7.x86_64[root@ip-10-164-175-246 ~]# cat /etc/exports/var/www/HTML/  ip-10-184-161-46.ec2.internal(rw)[root@ip-10-164-175-246 ~]#

第二个节点:

[root@ip-10-184-161-46 ~]# mount ip-10-164-175-246.ec2.internal:/var/www/HTML/ /mnt/[root@ip-10-184-161-46 ~]# touch /mnt/$$touch: cannot touch ‘/mnt/3326’: Permission denIEd[root@ip-10-184-161-46 ~]#

为什么我不能通过NFS向/ mnt /写入任何内容?

解决方法 您的导出是否使用root_squash?从 CentOS docs:

root_squash — Prevents root users connected remotely from having root
privileges and assigns them the user ID for the user nfsnobody. This
effectively “squashes” the power of the remote root user to the lowest
local user,preventing unauthorized alteration of files on the remote
server. Alternatively,the no_root_squash option turns off root
squashing. To squash every remote user,including root,use the
all_squash option. To specify the user and group IDs to use with
remote users from a particular host,use the anonuID and anongID
options,respectively. In this case,a special user account can be
created for remote NFS users to share and specify
(anonuID=,anongID=),where is the
user ID number and is the group ID number.

你需要添加标志no_root_squash来禁用它,因为它默认是打开的.

总结

以上是内存溢出为你收集整理的无法写入挂载点(nfs-server),获得“权限被拒绝”全部内容,希望文章能够帮你解决无法写入挂载点(nfs-server),获得“权限被拒绝”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1045292.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存