NFS mount.nfs: access denied by server while mounting 一个解决办法
生活随笔
收集整理的這篇文章主要介紹了
NFS mount.nfs: access denied by server while mounting 一个解决办法
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
mount.nfs: access denied by server while mounting 一個解決辦法 ?
2011-06-30 17:22:06| ?分類: 技術探討 | ?標簽:linux ?常見問題 ?服務器 ? |字號 訂閱 這兩天在搭建嵌入式開發(fā)環(huán)境,配置好NFS服務器后,遇到了一個很糾結的錯誤 使用 mount -t nfs 127.0.0.1:/home/lzgonline/rootfs /mnt 和 mount -t nfs 192.168.1.9:/home/lzgonline/rootfs /mnt 本機掛載nfs則沒有問題,然而使用 mount -t nfs 192.168.3.12:/home/lzgonline/rootfs /mnt 時卻出現(xiàn)了問題,導致開發(fā)板無法通過nfs掛載啟動,其中192.128.3.12 和 192.128.1.9(即nfs服務器)之間建立了映射(DMZ)關系。 mount.nfs: access denied by server while mounting 192.168.3.12:/home/lzgonline/rootfs 百度、谷歌了很久,大部分都說是權限設置有問題,其實文件夾權限都設為777了,權限上都沒問題,hosts.deny和hosts.allow都保留默認設置,防火墻也關了,該設置的都設置了,但還是被拒絕,很是郁悶,就在一籌莫展的時候,通過查看一些linux技術論壇后逐漸找到了問題所在。 首先使用命令查看出錯日志文件 [root@lzgonline init.d]# cat /var/log/messages | grep mount Jun 29 00:49:04 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 1689 Jun 29 00:51:02 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 1710 Jun 29 01:02:17 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 1916 Jun 29 01:09:51 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 2157 Jun 29 01:17:02 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 2318 從出錯日志可以看出,mount.nfs: access denied by server while mounting 192.168.3.12:/home/lzgonline/rootfs 被拒絕的原因是因為使用了非法端口,功夫總沒白費,終于在一個linux技術論壇上找到了答案: I googled and found that since the port is over 1024 I needed to add the "insecure" option to the relevant line in /etc/exports on the server. Once I did that (and ran exportfs -r), the mount -a on the client worked.
//如果端口號大于1024,則需要將 insecure 選項加入到配置文件(/etc/exports)相關選項中mount客戶端才能正常工作:
查看 exports 手冊中關于 secure 選項說明也發(fā)現(xiàn)確實如此
[root@lzgonline init.d]# man exports
secure,This ?option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure.
//secure 選項要求mount客戶端請求源端口小于1024(然而在使用 NAT 網(wǎng)絡地址轉換時端口一般總是大于1024的),默認情況下是開啟這個選項的,如果要禁止這個選項,則使用 insecure 標識
修改配置文件/etc/exports,加入 insecure 選項
/home/lzgonline/rootfs ?*(insecure,rw,async,no_root_squash)
保存退出
然后重啟nfs服務:service nfs restart
然后問題就解決了
2011-06-30 17:22:06| ?分類: 技術探討 | ?標簽:linux ?常見問題 ?服務器 ? |字號 訂閱 這兩天在搭建嵌入式開發(fā)環(huán)境,配置好NFS服務器后,遇到了一個很糾結的錯誤 使用 mount -t nfs 127.0.0.1:/home/lzgonline/rootfs /mnt 和 mount -t nfs 192.168.1.9:/home/lzgonline/rootfs /mnt 本機掛載nfs則沒有問題,然而使用 mount -t nfs 192.168.3.12:/home/lzgonline/rootfs /mnt 時卻出現(xiàn)了問題,導致開發(fā)板無法通過nfs掛載啟動,其中192.128.3.12 和 192.128.1.9(即nfs服務器)之間建立了映射(DMZ)關系。 mount.nfs: access denied by server while mounting 192.168.3.12:/home/lzgonline/rootfs 百度、谷歌了很久,大部分都說是權限設置有問題,其實文件夾權限都設為777了,權限上都沒問題,hosts.deny和hosts.allow都保留默認設置,防火墻也關了,該設置的都設置了,但還是被拒絕,很是郁悶,就在一籌莫展的時候,通過查看一些linux技術論壇后逐漸找到了問題所在。 首先使用命令查看出錯日志文件 [root@lzgonline init.d]# cat /var/log/messages | grep mount Jun 29 00:49:04 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 1689 Jun 29 00:51:02 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 1710 Jun 29 01:02:17 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 1916 Jun 29 01:09:51 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 2157 Jun 29 01:17:02 lzgonline mountd[1644]: refused mount request from 192.168.3.12 for /home/lzgonline/rootfs (/home/lzgonline/rootfs): illegal port 2318 從出錯日志可以看出,mount.nfs: access denied by server while mounting 192.168.3.12:/home/lzgonline/rootfs 被拒絕的原因是因為使用了非法端口,功夫總沒白費,終于在一個linux技術論壇上找到了答案: I googled and found that since the port is over 1024 I needed to add the "insecure" option to the relevant line in /etc/exports on the server. Once I did that (and ran exportfs -r), the mount -a on the client worked.
//如果端口號大于1024,則需要將 insecure 選項加入到配置文件(/etc/exports)相關選項中mount客戶端才能正常工作:
查看 exports 手冊中關于 secure 選項說明也發(fā)現(xiàn)確實如此
[root@lzgonline init.d]# man exports
secure,This ?option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure.
//secure 選項要求mount客戶端請求源端口小于1024(然而在使用 NAT 網(wǎng)絡地址轉換時端口一般總是大于1024的),默認情況下是開啟這個選項的,如果要禁止這個選項,則使用 insecure 標識
修改配置文件/etc/exports,加入 insecure 選項
/home/lzgonline/rootfs ?*(insecure,rw,async,no_root_squash)
保存退出
然后重啟nfs服務:service nfs restart
然后問題就解決了
總結
以上是生活随笔為你收集整理的NFS mount.nfs: access denied by server while mounting 一个解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu 14.04 samba
- 下一篇: raspberry树莓派NFS搭建