web-dev-qa-db-fra.com

NFS: accès refusé par le serveur lors du montage. côté client est un proxmox LXC (!)

désolé si ce sujet duplique d'autres sujets, mais je ne trouve pas de réponse à ces sujets.

qu'est-ce que j'ai:

le serveur est U buntu 14.04.5 LTS

le client est buntu 14.04.2 LTS - c’est le proxmox LXC

#cat /etc/exports

/nfs        192.168.88.0/24(ro,fsid=0,insecure,no_root_squash,no_subtree_check,sync)
/nfs/keycdn 192.168.88.0/24(rw,nohide,insecure,no_root_squash,no_subtree_check,sync)

Si j'exécute cette commande depuis le serveur:

mount 192.168.88.185:/nfs/keycdn /mnt

C'est monté, et ça marche - je peux créer un fichier

Si je cours côté client, j'obtiens une erreur:

root@kafka-02:/# mount 192.168.88.185:/nfs/keycdn /mnt
mount.nfs: access denied by server while mounting 192.168.88.185:/nfs/keycdn

J'ai de tels droits sur un dossier: serveur

#ll /nfs/
drwxrwxrwx  3 nobody nogroup 4096 Mar 27 13:49 ./
drwxr-xr-x 24 root   root    4096 Mar 27 12:41 ../
drwxrwxrwx  2 nobody nogroup 4096 Mar 27 15:17 keycdn/

Pour faire effet après avoir modifié/etc/exports, j'ai lancé exportfs -rav et le service redémarrage du serveur nfs-kernel

J'ai essayé de définir le vers de NFS dans/etc/fstab côté client. mais sans effet

Il y a des instructions détaillées sur l'exécution de la commande mount sur le serveur et le client:

Serveur

mount -vvvvvv 192.168.88.185:/nfs/keycdn /mnt
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: no type was given - I'll assume nfs because of the colon
mount: spec:  "192.168.88.185:/nfs/keycdn"
mount: node:  "/mnt"
mount: types: "nfs"
mount: opts:  "(null)"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "192.168.88.185:/nfs/keycdn"
mount: external mount: argv[2] = "/mnt"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw"
mount.nfs: timeout set for Mon Mar 27 15:51:33 2017
mount.nfs: trying text-based options 'vers=4,addr=192.168.88.185,clientaddr=192.168.88.185'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'addr=192.168.88.185'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.88.185 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.88.185 prog 100005 vers 3 prot UDP port 34598

Client vers = 3

mount -o 'vers=3' -vvvvvvv 192.168.88.185:/nfs/keycdn /mnt
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: no type was given - I'll assume nfs because of the colon
mount: spec:  "192.168.88.185:/nfs/keycdn"
mount: node:  "/mnt"
mount: types: "nfs"
mount: opts:  "vers=3"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "192.168.88.185:/nfs/keycdn"
mount: external mount: argv[2] = "/mnt"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,vers=3"
mount.nfs: timeout set for Mon Mar 27 15:52:32 2017
mount.nfs: trying text-based options 'vers=3,addr=192.168.88.185'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.88.185 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.88.185 prog 100005 vers 3 prot UDP port 34598
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.88.185:/nfs/keycdn

vers = 4

mount -o 'vers=4' -vvvvvvv 192.168.88.185:/nfs/keycdn /mnt
mount: fstab path: "/etc/fstab"
mount: mtab path:  "/etc/mtab"
mount: lock path:  "/etc/mtab~"
mount: temp path:  "/etc/mtab.tmp"
mount: UID:        0
mount: eUID:       0
mount: no type was given - I'll assume nfs because of the colon
mount: spec:  "192.168.88.185:/nfs/keycdn"
mount: node:  "/mnt"
mount: types: "nfs"
mount: opts:  "vers=4"
mount: external mount: argv[0] = "/sbin/mount.nfs"
mount: external mount: argv[1] = "192.168.88.185:/nfs/keycdn"
mount: external mount: argv[2] = "/mnt"
mount: external mount: argv[3] = "-v"
mount: external mount: argv[4] = "-o"
mount: external mount: argv[5] = "rw,vers=4"
mount.nfs: timeout set for Mon Mar 27 15:56:55 2017
mount.nfs: trying text-based options 'vers=4,addr=192.168.88.185,clientaddr=192.168.88.252'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.88.185:/nfs/keycdn
1
DeamonMV

Cette réponse ne vous aidera que si vous utilisez LXC proxmox, mais je pense que vous devriez essayer la sienne dans un autre cas aussi.

Le problème était du côté de proxmox. Proxmox a apparmor et cette chose bloque tout.

Pour arrêter Apparmor et le rendre inutilisable, procédez comme suit.

# /etc/init.d/apparmor stop
# /etc/init.d/apparmor teardown
# update-rc.d apparmor disable

après cette étape, tout commence à fonctionner comme un charme

1
DeamonMV