NFSv4 Permission Issues with Admin Users
Asked by
rug.size.5x7
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?
Answers
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.
Reply to this answer
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.
Reply to this answer
It's important to note that just because the admin user can write to a.txt doesn't mean they should have rights in the gitea directory. This behavioral inconsistency can be confusing, especially since you're seeing them as part of the gitea group in one context and not in another. You might want to explore that option of changing ownership since that could simplify permissions too.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions