Sticky Bit Permissions with Linux

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 them.

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 should work.

There is a special permission ‘t’ is set on these kind of directories.

tmp-sticky-bit
tmp-sticky-bit

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.

sticky-bit-permissions1
sticky-bit-permissions1

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

sticky-bit-permissions2
sticky-bit-permissions2

Removing Sticky Bit from a Directory

You can easily remove sticky bit from directory by using following command.

# chmod  -t  /shared
# chmod  775  /shared

removing-sticky-bit-Linux
removing-sticky-bit-Linux

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.

68 Replies to “Sticky Bit Permissions with Linux”

  1. I would also like to mention that most individuals that find themselves without health insurance are normally students, self-employed and those that are not working. More than half from the uninsured are really under the age of Thirty five. They do not think they are looking for health insurance since they’re young and also healthy. Its income is generally spent on houses, food, plus entertainment. Most people that do go to work either 100 or part time are not provided insurance through their jobs so they go without with the rising cost of health insurance in the United States. Thanks for the concepts you share through your blog.

  2. It’s perfect time to make some plans for the future and it’s time to be happy.
    I’ve read this post and if I could I want to suggest you
    few interesting things or suggestions. Maybe you could write next articles referring to this article.

    I desire to read more things about it!

  3. I’ll immediately grasp your rss feed as I can’t in finding your e-mail subscription link or e-newsletter service.
    Do you have any? Kindly allow me know in order that I could subscribe.
    Thanks.

  4. Pingback: viagra pills
  5. Pingback: viagra tablets
  6. Pingback: sildenafil
  7. I have been surfing online more than 4 hours today, yet I
    never found any interesting article like yours. It is pretty worth enough for me.
    In my view, if all website owners and bloggers made good content as
    you did, the internet will be much more useful than ever
    before.

  8. Pingback: cheap viagra
  9. Pingback: viagra for sale
  10. Pingback: buy generic cialis
  11. Pingback: generic viagra
  12. Pingback: generic cialis
  13. Hi! I’ve been following your blog for some time now and finally got the courage to go
    ahead and give you a shout out from Dallas Texas! Just wanted to tell you keep up the great job!

  14. Hi, I do believe this is a great web site. I stumbledupon it 😉 I will come back once again since i
    have bookmarked it. Money and freedom is the best
    way to change, may you be rich and continue to help other people.

  15. It’s the best time to make some plans for the
    future and it is time to be happy. I have read this post and
    if I could I desire to suggest you few interesting things or tips.

    Maybe you can write next articles referring to this article.
    I desire to read more things about it!

  16. Howdy! Someone in my Facebook group shared this website with us so I came to give it a look.
    I’m definitely enjoying the information. I’m book-marking and
    will be tweeting this to my followers! Exceptional blog and amazing design and style.

  17. Hey there just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Safari.
    I’m not sure if this is a format issue or something to do with internet browser compatibility
    but I thought I’d post to let you know. The style and design look great though!
    Hope you get the issue resolved soon. Thanks

  18. I have been surfing on-line greater than three hours as
    of late, but I never found any attention-grabbing article like yours.
    It is lovely value enough for me. In my view, if all website owners and bloggers made good content material as you probably did, the internet
    will be a lot more helpful than ever before.

  19. I’ve been surfing online greater than three hours as of late,
    but I by no means found any fascinating article like yours.
    It’s lovely price sufficient for me. In my view, if all webmasters and bloggers made just right content material as you
    did, the internet shall be much more helpful than ever before.

  20. It’s the best time to make a few plans for the longer term and it’s time to be happy.
    I have read this put up and if I could I desire
    to recommend you some interesting issues or suggestions.
    Maybe you can write next articles relating to this article.
    I desire to read even more things about it!

  21. I have been browsing online more than 3 hours these days,
    but I by no means found any interesting article like yours.
    It is lovely worth sufficient for me. In my opinion, if all
    webmasters and bloggers made good content material as you probably did, the internet can be much more helpful than ever before.

Leave a Reply

Your email address will not be published. Required fields are marked *