Sample Header Ad - 728x90

autofs nfs share served and mounted on same PC reporting permission denied when writing

1 vote
0 answers
605 views
I am using nfs between multiple Debian 10 machines in my local network, with the same basic setting across the board, and they are all working as expected. I am using autofs as root to mount and unmount the nfs shares on each machine, also using the same basic settings everywhere. Users on each client machine can access the mounted shares because they are owned by nobody:nogroup. So far, I have always been mounting shares from a server machine on a client machine, with no issues. So two separate machines. I am now attempting to mount a share served from a machine by using autofs on the same machine. So server and client on the same machine. autofs is mounting the share without issues, and non-root users can list folder contents and view files no problem, but when non-root users attempt to write to the share, they get "permission denied": $ touch test.file touch: cannot touch 'test.file': Permission denied $ echo "content" > test.file bash: test.file: Permission denied This happens whether I use 127.0.0.1 on loopback or 192.168.x.y on ethernet or wifi interface to access the share. Other machines use autofs to mount these same shares with the same settings without issue and this machine similarly use autofs to mount shares from other machines using the same settings again without issue. These are the nfs server settings: $ sudo exportfs -v /exports/share 127.0.0.1/32(rw,wdelay,root_squash,all_squash,sec=sys,rw,secure,root_squash,all_squash) /exports/share 192.168.0.0/16(rw,wdelay,root_squash,all_squash,sec=sys,rw,secure,root_squash,all_squash) These are the autofs settings, which are loaded via a master map in another file: $ cat /etc/auto.shares share_loopback -fstype=nfs4,rw,retry=0,hard,noac,noexec,proto=tcp 127.0.0.1:/exports/share share_network -fstype=nfs4,rw,retry=0,hard,noac,noexec,proto=tcp 192.168.x.y:/exports/share When a user manually mounts the same nfs share on the same machine using the same basic settings, everything works fine, without permission problems. $ sudo mount -t nfs4 -o rw,hard,noac,noexec,proto=tcp 127.0.0.1:/exports/share /media/share_loopback $ sudo mount -t nfs4 -o rw,hard,noac,noexec,proto=tcp 192.168.x.y:/exports/share /media/share_network It seems like autofs under the hood is doing something differently than when I mount manually. So what is causing this mount through autofs to report "Permission denied", and how can I get it to work?
Asked by tompi (292 rep)
Aug 1, 2021, 09:18 PM
Last activity: Oct 18, 2024, 11:52 AM