Register a domain and help support LQ
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-18-2006, 01:49 AM   #1
Registered: Mar 2006
Posts: 41

Rep: Reputation: 15
How does Sticky Bit work ?

Hello ,

Can anyone pls tell me how Sticky bit, SUID and SGID works ? It'd be appreciated if anyone can explain those in detail with example....

thanks in advance..
Old 03-18-2006, 03:59 AM   #2
Registered: Mar 2006
Posts: 34

Rep: Reputation: 15
I copied this extract from man chmod

On older Unix systems, the sticky bit caused executable files to be
hoarded in swap space. This feature is not useful on modern VM sys-
tems, and the Linux kernel ignores the sticky bit on files. Other
kernels may use the sticky bit on files for system-defined purposes.
On some systems, only the superuser can set the sticky bit on files.

When the sticky bit is set on a directory, files in that directory may
be unlinked or renamed only by root or their owner. Without the
sticky bit, anyone able to write to the directory can delete or rename
files. The sticky bit is commonly found on directories, such as /tmp,
that are world-writable.
Old 03-18-2006, 04:55 AM   #3
Senior Member
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 49
and for the other ones,

setuid/setgid on an executable file:
when you run the file, it runs with the privileges of the user/group that owns the file, instead of yours

setuid/setgid on a directory:
when you create a new file or subdirectory in the directory, they will be owned by the user/group that owns the directory, instead of yours


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sticky Bit Doesn't Seem to work krishvij Linux - Newbie 5 05-10-2005 06:31 PM
Losing sticky bit privilege when using fork() jones507 Programming 1 11-13-2003 04:57 PM
Sticky Bit tarballed Linux - General 4 07-03-2002 04:54 PM
Sticky bit question...need help rootlinux Linux - General 1 01-26-2002 06:12 PM
sticky bit motiram Linux - General 1 08-01-2001 01:34 PM

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration