Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop getting bit by the setgid bit on shared folders
🧩 The Challenge
Setting up a shared folder for the team usually starts fine until someone creates a file that only they can edit, leaving everyone else stuck behind a permission denied wall. I’ve wasted countless hours manually fixing group ownership on subdirectories because people forget to check their umask.
💡 The Fix
Flip the setgid bit on your parent directory so that every new file or folder automatically inherits the primary group of the parent directory. It makes shared workspaces actually shareable without you playing sysadmin janitor all day.
chmod g+s /path/to/shared/directory
⚙️ Why It Works
Setting this bit forces new files inside that directory to adopt the group ID of the folder itself, rather than the primary group of the user who happened to create the file.
🚀 Pro-Tip: Pair this with a proper umask in the team’s profile files if you want to ensure the group has write permissions from the jump.
Linux Tips & Tricks | © ngelinux.com | 10/23/2026
