Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop sticky bits from letting users delete each other’s data
🧩 The Challenge
You’ve probably seen a team share a common directory where everyone needs write access, but suddenly someone accidentally deletes a file they shouldn’t have. It’s a headache that’s cost me a full morning of restoring from tapes more than once.
💡 The Fix
Just flip the sticky bit on that shared directory. It limits file deletion to only the file owner, root, or the directory owner, which is a life-saver for shared workspaces.
chmod +t /path/to/shared/directory
⚙️ Why It Works
Setting this special bit changes the directory’s behavior so that even if a user has write access to the folder, they can’t unlink files unless they own them. It’s a simple security layer that prevents one clumsy intern from nuking the entire project directory.
🚀 Pro-Tip: Run ls -ld on the directory and look for the ‘t’ at the end of the permissions string to confirm it’s actually active.
Linux Tips & Tricks | © ngelinux.com | 9/6/2026
