
Eu tenho um host Ubuntu 16.04 com um endereço IP 192.168.1.35
e dois clientes VM: Ddebian 8 Jessie e CentOS 7. Eu executo nfs server
no meu host e nfs client
em ambos os meus convidados. A partir do convidado Debian ele é montado nfs-share
a partir do host sem nenhum problema. O problema está no meu convidado CentOS
Quando tento montar o nfs-share de dentro do convidado, ele emite o seguinte erro:
[hedin@localhost ~]$ sudo mount -a
mount.nfs: access denied by server while mounting 192.168.1.35:/home/hedin/export/eudyptula
Este é o /etc/fstab do meu convidado:
#
# /etc/fstab
# Created by anaconda on Mon Apr 10 16:16:12 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/cl-root / xfs defaults 0 0
UUID=46ddae58-4556-492c-8e23-8c56a4e067d9 /boot xfs defaults 0 0
/dev/mapper/cl-swap swap swap defaults 0 0
192.168.1.35:/home/hedin/export/eudyptula /home/hedin/mnt/host nfs rw,hard,intr,bg 0 0
Firewall está desativado:
[hedin@localhost ~]$ systemctl is-enabled firewalld
disabled
SELinux está desabilitado:
[hedin@localhost ~]$ cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
SELINUX=disabled
SELINUXTYPE=targeted
Todos os hosts são permitidos:
[hedin@localhost ~]$ cat /etc/hosts.allow
#
# hosts.allow This file contains access rules which are used to
ALL: ALL: ALLOW
Poderíamos ver o host nfs-share dentro do convidado:
[hedin@localhost ~]$ sudo showmount -e 192.168.1.35
Export list for 192.168.1.35:
/home/hedin/export/eudyptula 192.168.1.0/24
/home/hedin/export 192.168.1.0/24
E esta é /etc/export
a configuração dos meus hosts:
hedin@home:~/projects/open-source/linux$ cat /etc/exports
/home/hedin/export 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,async)
/home/hedin/export/eudyptula 192.168.1.0/24(rw,nohide,insecure,no_subtree_check,async)
Então, não sei o que perdi na minha configuração. Alguma ideia?
Responder1
O problema estava no arquivo /etc/exports no servidor. O IP da VM do cliente não corresponde à máscara IP do servidor. Permiti acesso a qualquer IP e agora posso montar os compartilhamentos no convidado. Esta é a nova configuração:
/home/hedin/export *(rw,fsid=0,insecure,no_subtree_check,async)
/home/hedin/export/eudyptula *(rw,nohide,insecure,no_subtree_check,async)
Responder2
Por favor, remova a seguinte linha do arquivo /etc/sysconfig/selinux e reinicie a máquina centos 7.
SELINUXTYPE = direcionado
Atualize a seguinte linha no arquivo /etc/fstab e monte novamente a pasta compartilhada na máquina centos 7.
192.168.1.35:/home/hedin/export/eudyptula /home/hedin/mnt/host padrões nfs 0 0