This is a special kind of permission in Linux think of a situation
where you need a conman shared folder where all users can create files
but these users can only modify the files which are owned / created by
It is actually possible. This can be achieved by setting Sticky Bit on that directory.
In Linux there is a directory “/tmp” on which Sticky bit is by default set. This directory is used by different users and running processes to created temporary files which are deleted on reboot.
If you are on Linux system now you can try this now go to the “/tmp”
directory on your system and try to create a file or a directory. It
There is a special permission ‘t’ is set on these kind of directories.
Set Sticky Bit on a Directory
you can use following command to setup Sticy Bit on a Directory. I have already created a new directory named shared.
# chmod 777 shared
# chmod +t shared
You can set this with numeric number as well. Just add 1 in front.
# chmod 1777 shared
Now lets test the sticky bit if it is working:
User ‘admin1’ has created one file named ‘admin1-file’ in the /shared directory.
User mars has tried to delete and move the file but failed
But user ‘mars’ is able to create a new file ‘mars-file’ in /shared directory and perform any modification on that
Removing Sticky Bit from a Directory
You can easily remove sticky bit from directory by using following command.
# chmod -t /shared
# chmod 775 /shared
Thats it we have covered the Sticky Bit permissions in Linux. Let me know if how you feel about this article. Stay tuned more good stuff is on the way.