Stop sticky bits from letting users delete files they don’t own
Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop sticky bits from letting users delete files they don’t own
🧩 The Challenge
You finally got a shared scratch directory set up for the dev team, only to find someone deleted a file they didn’t create because they had write access to the folder. I spent a whole afternoon tracking down who nuked a critical log file before realizing the directory permissions were just way too loose.
💡 The Fix
Flip the sticky bit on the directory so only the file owner, the directory owner, or root can delete or rename files inside it. It saves you from those “where did my file go” support tickets that come in at 4:55 PM on a Friday.
chmod +t /path/to/shared/directory
⚙️ Why It Works
Setting this bit on a directory restricts deletion to only the owner of the file itself, effectively ignoring the write permissions that other users have on the containing directory. It’s the only way to keep a shared workspace from turning into a digital lawless wasteland.
🚀 Pro-Tip: Look for the ‘t’ at the end of your directory permissions in ls -ld; if you see a ‘T’ instead, it means the bit is set but the directory lacks execute permissions, which is a common foot-gun.
Linux Tips & Tricks | © ngelinux.com | 7/23/2026
