Stop sticky bits from letting users delete each other’s data

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

Stop sticky bits from letting users delete each other’s data

🧩 The Challenge

You know that classic headache where everyone dumps files into a shared /tmp or project folder and then some junior dev accidentally deletes a colleague’s work? It happens way more often than you’d think, and it’s a nightmare to explain to the team.

💡 The Fix

Just set the sticky bit on that shared directory so only the file owner can delete their own stuff. It keeps the directory open for writing but locks down the deletion rights.

chmod +t /path/to/shared/directory

⚙️ Why It Works

Setting that extra bit tells the kernel to restrict file deletion to the owner, the root user, or the directory owner itself. You’ll see a little ‘t’ at the end of the permissions string when it’s active.

🚀 Pro-Tip: Check if your shared folder already has it by looking for the ‘t’ in the output of ls -ld.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted