Stop letting group-write bit turn your directories into a free-for-all

Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)

Stop letting group-write bit turn your directories into a free-for-all

🧩 The Challenge

You’ve probably spent an hour hunting down why some genius deleted a production config file inside a shared folder, only to realize the directory had the write bit set for everyone in the group. It is the easiest way to lose data without anyone actually breaking the system.

💡 The Fix

Use the sticky bit or setgid bit to lock down directory behavior so users can only touch their own files or force group inheritance. This keeps your shared workspaces from becoming the wild west.

chmod g+s, +t /path/to/shared/directory

⚙️ Why It Works

Setting the setgid bit ensures new files inherit the parent group, while that +t flag stops people from deleting files they don’t own, even if they have write access to the folder. It saves your bacon when a team of five is all dropping files into one repo.

🚀 Pro-Tip: Always double-check your umask settings in /etc/profile so your users don’t accidentally create files with overly permissive defaults in the first place.

Linux Tips & Tricks | © ngelinux.com | 10/14/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted