Stop getting burned by sticky bits on shared directories
Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop getting burned by sticky bits on shared directories
🧩 The Challenge
You ever have a team folder where everyone just deletes each other’s files, and then you spend all morning digging through backups because someone hit rm by accident? I’ve been there, and watching a junior dev wipe out a week of work with one wrong glob is enough to make you lose your mind.
💡 The Fix
Use the sticky bit on the directory so only the file owner can delete their own stuff, even if they have write access to the parent folder. It’s the most underrated safety net in the unix permissions model.
chmod +t /path/to/shared/directory
⚙️ Why It Works
Setting that little bit tells the kernel that regardless of write permissions, deletions are restricted to the file owner, the directory owner, or root. It’s the standard way to stop the “who deleted my file” slack messages from appearing every Monday.
🚀 Pro-Tip: Look for the T or t flag at the end of the permissions string in an ls -l output to verify it’s active.
Linux Tips & Tricks | © ngelinux.com | 7/27/2026
