Welkom bij Bandhosting.nl,
hosting en webdevelopment.

Fix access denied error while mounting a NFS share from mac osx on linux

If you ever get this error while mounting a NFS share from OSX on Linux:

root@stretch:/# mount -v 192.168.1.20:/Users/adam/Downloads /export
mount.nfs: access denied by server while mounting 192.168.1.20:/Users/adam/Downloads

Or in verbose modus:

root@stretch:/# mount -v 192.168.1.20:/Users/adam/Downloads /export
mount.nfs: timeout set for Thu Jan  4 11:28:51 2018
mount.nfs: trying text-based options 'vers=4.2,addr=192.168.1.20,clientaddr=10.0.2.15'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.1,addr=192.168.1.20,clientaddr=10.0.2.15'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.0,addr=192.168.1.20,clientaddr=10.0.2.15'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=192.168.1.20'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.20 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.1.20 prog 100005 vers 3 prot UDP port 996
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.1.20:/Users/adam/Downloads

You can fix this by setting nfs.server.mount.require_resv_port = 0 in /etc/nfs.conf. Do not forget to reload the nfs server on osx after you apply this config setting by using the following command: sudo nfsd restart