sticky bit — used primarily on directories, this bit dictates that a file created in the directory can be removed only by the user who created the file. it is indicated by the character t in place of the x in the everyone category. in Red Hat Linux the sticky bit is set by default on the /tmp/ directory for exactly this reason.
source :http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/ch-acctsgrps.html
if somebody wants to xperience what far this sticky bit i used for do the following
ReplyDelete1.create two users say jack and jill
2.login as jack and goto /tmp (Note sticky bit set on /tmp), and touch jack.txt
3.login as jill and goto /tmp (Note sticky bit set on /tmp), and touch jill.txt
Now Sticky bit plays an imp role lets see how
Now
1.login as jack try to delete file created by jill ie jill.txt u can never bcoz sticky bit !!!!! got it ?????
2.similarly neither jill can not delete file created by jack ie jack.txt
Now
What iff u remove sticky bit ?????
u can definitely delete files of each other once again note permissions on /tmp it has got full permissions for all
vovhhh nice comment girish its definitley helpfull, geeks like u must post such comments which helps newbis ;-) surely it helps newbies
ReplyDelete