- mount.nfs: доступ запрещен сервером при монтировании
- “mount.nfs: access denied by server while mounting” – how to resolve
- Problem
- Solution
- 1. Try mounting with NFSv3
- 2. Check /etc/exports for correct share options
- 3. Check NFS server permissions
- 4. Using tcpdump
- Access denied error in NFS for root account
- Current setup
- Issue
- Solution
- Conclusion
- Thread: mount.nfs: access denied by server
- mount.nfs: access denied by server
- Re: mount.nfs: access denied by server
- Re: mount.nfs: access denied by server
- Re: mount.nfs: access denied by server
- mount.nfs: access denied by server while mounting #5424
- Comments
- markusm18 commented Mar 3, 2015
- carstenhag commented Apr 9, 2015
- eggyal commented Aug 18, 2015
mount.nfs: доступ запрещен сервером при монтировании
У меня есть проблема, я гуглял по крайней мере 6 часов 28 часов без удачи. Всякий раз, когда я пытаюсь смонтировать каталог, я получаю следующую ошибку (подробная версия в конце):
mount.nfs: доступ запрещен сервером при монтировании:
Первоначально я использовал computer1 в качестве сервера NFS, но я перенес его на computer2 и я пытаюсь сесть на computers3-8 , Как дальнейшее примечание, computer2 теперь действует как маршрутизатор dhcp для всех остальных компьютеров (даже computer1 ), но я почти уверен, что проблема связана с computer2 Настройки NFS, как я попробовал следующее:
- Попробуйте смонтировать папку с оригинала computer1 сервер к одному из computers3-8 клиенты — УСПЕХ
- Попробуйте смонтировать папку с оригинала computer1 сервер на новый computer2 сервер — УСПЕХ
- Попробуйте смонтировать папку из нового computer2 сервер к одному из computers3-8 клиенты — ОТКАЗ
- Попробуйте смонтировать папку из нового computer2 сервер на старый computer1 сервер — ОТКАЗ
- Попробуйте экспортировать, затем смонтировать любую другую папку на computer2 — ОТКАЗ
- SSH в и из computer2 — УСПЕХ
В дополнение к этому, я также проверил, чтобы соответствующие части /etc/exports В файле нет ошибок. Поэтому я почти абсолютно уверен, что это не проблема разрешения.
Вопрос: Учитывая, что это не сетевая ошибка, кто-нибудь может посоветовать мне, как мне начать отладку этой проблемы.
Подробный вывод:
Подробный вывод2:
Вот более прямой подход, который изолирует монтирование только в данном каталоге:
Я сталкивался с этим rpc.statd is not running but is required for remote locking ошибка раньше, но все поиски в мире мне совсем не помогли.
РЕДАКТИРОВАТЬ:
chaos попросил меня выполнить следующие команды и отобразить результаты:
Сначала на сервере:
А потом на клиенте
РЕДАКТИРОВАТЬ 2:
chaos попросил меня выполнить следующие команды и отобразить результаты:
Вот мой /etc/exports файл на сервере. Как вы видите, я пытаюсь использовать его имя, как это определено в /etc/hosts , его IP-адрес, и я также пытаюсь экспортировать различные папки. Все остальные строки я пропустил, так как они просто дубликаты последней строки, просто перенаправлены на другой распис.
Вот мой /etc/fstab файл на моем клиенте raspi5
РЕДАКТИРОВАТЬ 3:
Следуя некоторым советам здесь, я также установил insecure флаг в экспорте, но безрезультатно, а вот и вывод rpcinfo -p на клиенте и сервере:
РЕДАКТИРОВАТЬ 4:
Далее, следуя некоторым советам, я получил следующие журналы отладки:
РЕДАКТИРОВАТЬ 5:
Я добился некоторого прогресса и вывел следующее
Источник
“mount.nfs: access denied by server while mounting” – how to resolve
Problem
Mounting the nfs share from CentOS/RHEL NFS server on a NFS client gives error as shown below:
You can try running the mount command with the verbose option to get an detailed error on the issue.
Solution
This is a generic issue with NFS mounting at client and can occur due to many issues. Below are some of the most commonly occuring issues.
1. Try mounting with NFSv3
Sometimes the NFS server may only support NFSv3 connections. By default the mount command uses NFSv4, which may result is the error. To avoid this specify the NFSv3 while mounting the share.
2. Check /etc/exports for correct share options
Ensure /etc/exports is properly referring to the correct NFS client information for providing access. Some NFS servers require NFS client name to be resolvable to IP, thus it should be resolvable via DNS or specified in /etc/hosts of the NFS server.. The format of the /etc/exports file is:
Client options include (defaults are listed first):
ro / rw :
a) ro : allow clients read only access to the share.
b) rw : allow clients read write access to the share.
sync / async :
a) sync : NFS server replies to request only after changes made by previous request are written to disk.
b) async : specifies that the server does not have to wait.
wdelay / no_wdelay
a) wdelay : NFS server delays committing write requests when it suspects another write request is imminent.
b) no_wdelay : use this option to disable to the delay. no_wdelay option can only be enabled if default sync option is enabled.
no_all_squash / all_squash :
a) no_all_squash : does not change the mapping of remote users.
b) all_squash : to squash all remote users including root.
root_squash / no_root_squash :
a) root_squash : prevent root users connected remotely from having root access. Effectively squashing remote root privileges.
b) no_root_squash : disable root squashing.
3. Check NFS server permissions
– There could be issue with the NFS server sharing the NFS share. Try mounting the problematic share on another NFS client, to rule out the possibility of issue at NFS server.
– Set the permission as (ro,no_root_squash,sync) for nfs export on server end and run command:
Then try to mount the NFS share directory. If specifying the NFS client in /etc/exports by domain or hostname ensure the domain name maps to the correct IP, an incorrect entry in /etc/hosts for example could cause access to be denied.
4. Using tcpdump
In very rare cases, you may have to use the tcpdump to capture tcpdump of the mount operation. Run the below command first to start capturing the network packets. In another terminal start the NFS mount operation.
Источник
Access denied error in NFS for root account
Published: November 8, 2017 | Modified: June 25, 2020
Learn how to resolve access denied issues in the NFS mount point. Understand how to root access is limited in NFS and no_root_squash to be used.
Current setup
Access denied error in NFS share mount points when attempted to create file or directory even if rw option is set while exporting.
I had a directory named mydata which is exported from the NFS server. My /etc/exports file looks like this –
I mounted it on the NFS client client1 successfully. I am able to read all data within this directory from the NFS client.
Issue
I am not able to create a file or directory in the NFS mount even if rw option is set. I tried creating files, directory and I get access denied error.
Solution
By default, NFS prevents remote root users from gaining root-level privileges on its exports. It assigns user privileges of nfsnobody user to remotely logged in root users. This is what happened here and hence even if rw option is set, since we are using mount at root user we are not able to write any data on export.
This is called squashing root privileges to the normal ones. This to ensure accidental writing or modifying data on exports. You can set all_squash option which will squash privileges of all remote users including root to normal user nfsnobody .
For our issue, we have to set no_root_squash option on export so that remote root user keeps his power intact and will be able to write on the exported directory.
I changed my /etc/exports as below :
I re-exported directory using exportfs . Re-exporting mount points does not require the client to un-mount exported directories. Re-export also avoid the NFS server restart and catch up with new configuration.
That’s it! Now I am able to create files and directories in the exported directory on NFS client.
Conclusion
When you are using NFS mount points with root account on client-side then export them with no_root_squash option. This will ensure you don’t face access related issues on NFS mount points.
Источник
Thread: mount.nfs: access denied by server
Thread Tools
Display
mount.nfs: access denied by server
Hello forumgoers.
I have a slight problem setting up NFS on my local network (behind a router/wireless combo, I believe it’s DHCP).
So, here’s what I’ve done so far:
Here’s the problem:
What have I done wrong?
Re: mount.nfs: access denied by server
Hello forumgoers.
I have a slight problem setting up NFS on my local network (behind a router/wireless combo, I believe it’s DHCP).
So, here’s what I’ve done so far:
Here’s the problem:
to your mount command.
Re: mount.nfs: access denied by server
Thanks, roelforg. That mounted it, but nautilus freezes if I go to that location, and ‘ls’ just doesn’t respond.
Any suggestions, or just the lack of speed from my network? (and therefore needing a different solution for my filesharing).
EDIT: just teething problems. Seems to work fine now. Thank you!
Re: mount.nfs: access denied by server
Thanks, roelforg. That mounted it, but nautilus freezes if I go to that location, and ‘ls’ just doesn’t respond.
Any suggestions, or just the lack of speed from my network? (and therefore needing a different solution for my filesharing).
Well, a freeze is something.
Does the hd-led on your server turn on and do the network leds on either system blink while it freezes?
It could be network, but then you’ll only see the network leds blink and not the hd-led (as the hd alreade finished and the sys is waiting on the network).
Or a slow hd in the server.
Источник
mount.nfs: access denied by server while mounting #5424
Comments
markusm18 commented Mar 3, 2015
Mounting shared folders fails due to Vagrant putting the wrong IP address in the /etc/exports file when there are multiple interfaces using the 172.16.0.0/12 IP address space inside the virtual machine. This can reliably be reproduced with the Vagrantfile and steps shown below:
- Create the virtual machine with vagrant up
- Restart the host (this seems to be crucial — the issue does not reproduce without this step)
- Start the virtual machine with vagrant up and observe the NFS mount error as shown below:
Notice that Vagrant has incorrectly picked up the IP address of the «docker0» network interface (instead of the IP address of its own private network interface) and put it in /etc/exports !
Rebooting the virtual machine (without rebooting the host) after the initial NFS mount error often does not reproduce it. However, sometimes it does. But rebooting the host itself reliably reproduces the NFS mount error.
The text was updated successfully, but these errors were encountered:
carstenhag commented Apr 9, 2015
Nevermind me writing about stdin being the problem, I think the real issue comes from the mount.nfs access denied error.
eggyal commented Aug 18, 2015
Related issue here.
VM again has two private_network interfaces, but in my case one of those interfaces is a VirtualBox internal network (and therefore is unreachable from the host machine):
Whilst vagrant attempts to have the guest mount the folder using the host’s reachable address (i.e. that on the former network), it configures /etc/exports with the guest’s unreachable address (i.e. that on the latter network):
I tried reordering the configuration of the VM’s interfaces within the Vagrantfile , to no avail: presumably vagrant writes into /etc/exports the address of the first (private network?) interface to become available—and since the (unreachable) internal interface is statically addressed, it’s available before the dynamically addressed (reachable) interface.
Interfaces connected to networks unreachable from the host (such as VirtualBox internal networks) should obviously be excluded from the pool of potential interfaces considered for /etc/exports configuration. However, the simplest solution might be to provide a configuration directive that enables the Vagrantfile author to specify exactly which interface should be used.
Источник