07-20-2001
From what I understand, the "sticky" bit is only allowed to be set by a superuser via the chmod command. If set the "ls" format will show a "t" in the last position of the permissions.
The sticky bits purpose is to prevent a program from swapping out of of memory when not being used. Thus, the executable image of the program (file) stays in the "swap space" even when the program is NOT being executed. In effect, it would make the program run faster (no swapping to virtual memory involved).
Since the program gets "stuck" (in the swap space) it's called "sticky mode" (controlled by the "sticky bit". Since swap space is usually at a premium (on most systems) you wouldn't want too many programs running in "sticky mode".
I'm certainly not an expert, but the above is what I gathered through reading. Hope it helps. LY18
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a script that I want to be able to let user 'wcs1234' execute it, but when it runs, it will do so under the higher authority of 'cdunix'. It is my understanding that I accomplish this with a sticky bit. I have tried every variation of this but am unable to get this to work.
my script is... (2 Replies)
Discussion started by: hedrict
2 Replies
2. UNIX for Dummies Questions & Answers
What command string would you use to set the sticky bit on a directory that you own? (2 Replies)
Discussion started by: mma_buc_98
2 Replies
3. UNIX for Dummies Questions & Answers
I have the sticky bit set on my /tmp directory, but users are still able to remove files that are not owned by them. Does the /etc/group file get invloved in securing these files ?? (1 Reply)
Discussion started by: rob11g
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
could anyone please send me a link to learn/ know more about sticky bits? I am still not clear on the application of using a sticky bits.
Thanks for your help.
Regards,
UP (3 Replies)
Discussion started by: teenu18
3 Replies
5. UNIX for Dummies Questions & Answers
Hi ,
I am having file permision as
drwxrwsr_x
I kwo for deleting a file in the diretory i need w permsion as well ..
Say if i am having the permsion as
drwxrwsrwx - wil any one can delete the files in the directory ..
And one more question what is the s doing there ..... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies
6. UNIX for Dummies Questions & Answers
HI
What is sticky bit?
how can be see if the sticky bit for file is set?
WHat is meaning of sticky bit set on Directory?
What is the syntax to set the sticky bit? With example
Thanks (10 Replies)
Discussion started by: skyineyes
10 Replies
7. UNIX for Advanced & Expert Users
Hi,
I understand the purpose of sticky bit on directories. But I am not very clear about what the sticky bit do on a file.
Can any one explain me in detail and with example please.
Thanks in advance. (1 Reply)
Discussion started by: praveen_b744
1 Replies
8. Shell Programming and Scripting
I want a file I create to not be deletable by other users so I created a sticky bit by chmod 1644 on the file. chown'd it to root and then tried to delete (via GUI drag to trash and empty) as a non root user and it let me. is sticky bit only good for terminal deletes or something? (4 Replies)
Discussion started by: glev2005
4 Replies
9. AIX
What is sticky bit ...and where we aill use this.. how to set this bit in files and directories (1 Reply)
Discussion started by: udtyuvaraj
1 Replies
10. AIX
as far as i understand, if sticky bit is set on a directory, the files created under tht directory cannot be deleted by ordinary user...
but we can do ths by permission itself,,, tht's assign only read permission to tht dirrectory
wht 's the difference? (1 Reply)
Discussion started by: udtyuvaraj
1 Replies
LEARN ABOUT OPENDARWIN
sticky
sticky(5) Standards, Environments, and Macros sticky(5)
NAME
sticky - mark files for special treatment
DESCRIPTION
The sticky bit (file mode bit 01000, see chmod(2)) is used to indicate special treatment of certain files and directories. A directory for
which the sticky bit is set restricts deletion of files it contains. A file in a sticky directory can only be removed or renamed by a user
who has write permission on the directory, and either owns the file, owns the directory, has write permission on the file, or is a privi-
leged user. Setting the sticky bit is useful for directories such as /tmp, which must be publicly writable but should deny users permission
to arbitrarily delete or rename the files of others.
If the sticky bit is set on a regular file and no execute bits are set, the system's page cache will not be used to hold the file's data.
This bit is normally set on swap files of diskless clients so that accesses to these files do not flush more valuable data from the sys-
tem's cache. Moreover, by default such files are treated as swap files, whose inode modification times may not necessarily be correctly
recorded on permanent storage.
Any user may create a sticky directory. See chmod for details about modifying file modes.
SEE ALSO
chmod(1), chmod(2), chown(2), mkdir(2), rename(2), unlink(2)
BUGS
The mkdir(2) function will not create a directory with the sticky bit set.
SunOS 5.10 1 Aug 2002 sticky(5)