incapaz de gravar no ponto de montagem (nfs-server), obtendo “Permission denied”

19

Estou tentando configurar o NFS entre dois nós do RHEL7:

primeiro nó:

[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-utils
nfs-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 ~]# 

segundo nó:

[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 ~]# 

Por que não consigo escrever nada em /mnt/ over NFS?

    
por alexus 08.07.2014 / 18:23

1 resposta

24

Sua exportação utiliza root_squash ? Dos documentos do CentOS :

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.

Você precisará adicionar a sinalização no_root_squash para desativá-la, pois ela está ativada por padrão.

    
por 08.07.2014 / 18:40

Tags