r/linuxadmin • u/OneInchPunchMan • Apr 20 '26
NFSv4 - Admin permission issues
Hey r/linuxadmin , I have a weird one.
I have a NAS and a Server where the NAS serves /mnt/storage via NFSv4 to the Server.
There is also a user gitea:gitea (5203:5203) on both the NAS and Server admin is part of the gitea group.
The dir structure is:
/mnt/storage/ (775 admin:admin)
/mnt/storage/a.txt (664 gitea:gitea)
/mnt/storage/gitea/ (775 gitea:gitea + setgid)
My problem is that both admins can rw the a.txt file fine (appear to be in group gitea), however they cannot make new files in gitea/ dir (appear to be in "others").
How and why is that and am I missing some key concept here?
1
u/OneInchPunchMan Apr 20 '26
Could this have something to do with virtiofs, where the Host is passing the directory to the NAS VM?
1
u/OneInchPunchMan Apr 21 '26
I seem to have nailed it down as per: GitHub Issue and Documentation
I was banging my head for far too long on this. I guess LDAP it is then...
1
u/ihatepowershell Apr 20 '26 edited Apr 20 '26
If the permissions on the /mnt/storage/gitea/ directory are as above(775 gitea:gitea+setgid) then the admins would not have permissions to write(create new files) in that directory.
You could do one of the following:
I think option D is simplest depending on your environment.
You may want to check the group membership, e.g.
getent group admingetent group giteaThe issue that seems unexplained is why the admin user can write to a.txt with those permissions.
1
u/kai_ekael Apr 20 '26 edited Apr 20 '26
Checking, do the UIDs and GIDs match on the NAS and Server? If so, how?
Next, what is exact error message when an admin user tries to create a file in /mnt/storage/gitea? Note the timestamp, get the error from the command and check local syslog and NAS log as well at the same timestamp.