I'm having a peculiar problem with my setup where a NAS serves a directory via NFSv4 to a server. The user 'gitea' (with UID and GID 5203) is present on both the NAS and Server, and the admin user is part of the 'gitea' group. The directory structure looks like this: /mnt/storage/ has 775 permissions with admin:admin, a.txt has 664 permissions with gitea:gitea, and the /mnt/storage/gitea/ directory has 775 permissions with gitea:gitea along with setgid. My issue is that while both admins can read and write to the a.txt file, they can't create new files in the gitea/ directory, which appears to have a conflicting permission setup. What am I missing in this scenario?
2 Answers
It sounds like the issue could be tied to the gitea directory permissions. Since they are set to 775 (gitea:gitea), that means only users in the gitea group can write there. Admins won't have the write access since they're only part of the admin group. You could consider these options:
1. Add the admin users to the gitea group.
2. Change the permissions for 'others' (though that could pose a security risk).
3. Use Access Control Lists (ACLs) for more nuanced permission settings, but those can be a pain with NFSv4.
4. Change ownership to something like admin:gitea or gitea:admin. That might be the simplest route depending on your system setup.
You should also check if the UIDs and GIDs for the users on both the NAS and Server match. If they do, check the exact error message when an admin tries to create a file in the gitea directory—sometimes it helps to look at logs as well.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures