2017-03-27 74 views
-1

抱歉,但我開始相同的話題,因爲它https://stackoverflow.com/questions/22246477/mounting-nfs-results-in-access-denied-by-serverNFS:安裝時服務器拒絕訪問。客戶端是一個LXC proxmox(!)

我做的解決方案的所有步驟,但它沒有任何意義我。仍然不起作用。

我有什麼:

服務器爲U buntu 14.04.5 LTS

客戶端的Ubuntu 14.04.2 LTS - 這是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) 

如果我從服務器運行此命令:

mount 192.168.88.185:/nfs/keycdn /mnt 

它的安裝和工作 - 我可以創建一個文件

如果我在客戶端上運行,我得到一個錯誤:

[email protected]:/# mount 192.168.88.185:/nfs/keycdn /mnt 
mount.nfs: access denied by server while mounting 192.168.88.185:/nfs/keycdn 

我有一個文件夾上這樣的權利: 服務器

#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/ 

要修改/ etc/exports中我跑exportfs -rav和服務NFS的內核服務器重新啓動後生效

我試圖定義的NF VERS s在客戶端的/ etc/fstab中。但沒有效果

有上運行冗長mount命令在服務器和客戶端:

服務器

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 

客戶 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 
+0

我認爲,這個問題將得到更多的關注,如果您發佈此上http://askubuntu.com/網站。 – Reborn

+0

謝謝。我也會嘗試在askubuntu上發帖。 – DeamonMV

回答

1

只有當您使用LXC proxmox時,此答案纔有幫助,但我認爲您應該在其他情況下嘗試使用他。

問題出在proxmox方面。 Proxmox已經知道了,那東西阻止了一切。

要停止AppArmor的,讓他無法正常工作,做這個步驟

# /etc/init.d/apparmor stop 
# /etc/init.d/apparmor teardown 
# update-rc.d apparmor disable 
在此之後

步驟都開始工作就像一個魅力

+0

我有一個Proxmox容器的問題,你的答案是關鍵......謝謝。 – cgasp

相關問題