Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)
Stop the sticky bit from making your shared directories a free-for-all
đ§© The Challenge
Youâve set up a shared folder for the team to drop reports in, but then someone decides itâs hilarious to delete a coworkerâs file just because they have write access to the parent directory. Iâve wasted half a morning tracking down who nuked the production logs this way, and honestly, itâs a total headache.
đĄ The Fix
The sticky bit is your best friend here. It ensures that even if users have write access to the directory, they can only delete or rename files that they actually own themselves.
chmod +t /path/to/shared/directory
âïž Why It Works
Setting this bit on a directory changes the kernelâs behavior so that file deletion is restricted to the file owner, the directory owner, or the superuser. Itâs a simple flag that saves you from dealing with colleagues âaccidentallyâ cleaning up each otherâs work.
đ Pro-Tip: Run ls -ld and look for the âtâ at the end of the permissions string to confirm itâs actually active.
Linux Tips & Tricks | © ngelinux.com | 8/27/2026
