Stop letting your sticky bit directories become a free for all

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

Stop letting your sticky bit directories become a free for all

🧩 The Challenge

You know that feeling when you realize anyone can delete files from a shared folder even if they don’t own them? I spent way too long cleaning up a mess after a junior dev accidentally nuked a critical log file because the permissions were wide open.

💡 The Fix

Throw the sticky bit on those shared directories to ensure users can only delete the files they actually created. It is the easiest way to prevent someone from maliciously or accidentally destroying data they shouldn’t be touching.

chmod +t /path/to/shared/directory

⚙️ Why It Works

Setting this special permission bit tells the kernel that only the file owner, the directory owner, or root can remove or rename files within that directory. It turns a chaotic public space into a much safer environment for team collaboration.

🚀 Pro-Tip: Check for directories with the sticky bit set by looking for a t at the end of the mode string in ls -ld output.

Linux Tips & Tricks | © ngelinux.com | 8/1/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted