Stop secondary groups from breaking your shared workspace access
Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop secondary groups from breaking your shared workspace access
🧩 The Challenge
Setting up a shared directory for a dev team usually ends in tears because the default umask won’t grant group write access to new files. Everyone ends up playing the chmod game every single morning and it is infuriating.
💡 The Fix
Use the setgid bit on the parent directory so new files automatically inherit the group ID of the folder instead of the user’s primary group. It’s the easiest way to keep team folders writable without losing your mind.
chmod g+s /path/to/shared/directory
⚙️ Why It Works
Setting the setgid bit forces all new files created inside that directory to take on the directory’s group ownership rather than the creator’s default group. Everything becomes a lot cleaner once you stop manually fixing permissions on every single git pull.
🚀 Pro-Tip: Combine this with a restrictive default umask of 002 for your users if you want them to always be able to edit each other’s work without extra fuss.
Linux Tips & Tricks | © ngelinux.com | 8/13/2026
