Stop the sticky bit from making your shared directories a free-for-all
Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop the sticky bit from making your shared directories a free-for-all
🧩 The Challenge
You’ve set up a shared folder for the team to drop reports in, but then someone decides it’s hilarious to delete a coworker’s file just because they have write access to the parent directory. I’ve wasted half a morning tracking down who nuked the production logs this way, and honestly, it’s a total headache.
💡 The Fix
The sticky bit is your best friend here. It ensures that even if users have write access to the directory, they can only delete or rename files that they actually own themselves.
chmod +t /path/to/shared/directory
⚙️ Why It Works
Setting this bit on a directory changes the kernel’s behavior so that file deletion is restricted to the file owner, the directory owner, or the superuser. It’s a simple flag that saves you from dealing with colleagues “accidentally” cleaning up each other’s work.
🚀 Pro-Tip: Run ls -ld and look for the ‘t’ at the end of the permissions string to confirm it’s actually active.
Linux Tips & Tricks | © ngelinux.com | 8/27/2026
