Stop your custom scripts from breaking when you set the sticky bit

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

Stop your custom scripts from breaking when you set the sticky bit

🧩 The Challenge

Setting up a shared directory for a team seems fine until someone accidentally deletes a file they don’t own. I’ve spent way too long cleaning up mess-ups caused by people doing a recursive delete on the wrong folder.

💡 The Fix

Throw the sticky bit on the directory so only the file owner can delete or rename the items inside. It saves you from those frantic Monday morning emails asking where the hell the project files went.

chmod +t /path/to/shared/directory

⚙️ Why It Works

Setting that bit triggers a kernel check that prevents any user from unlinking files unless they own the file itself, the directory, or happen to be root. It’s a lifesaver for collaborative scratch pads.

🚀 Pro-Tip: Use ls -ld to double-check the bit is active; you should see a t at the end of the permissions string where the execute bit usually sits.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted