Download your favorite Linux distribution at LQ ISO.
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-23-2006, 04:07 AM   #1
Registered: Mar 2006
Posts: 41

Rep: Reputation: 15
Significance/reason of using SUID, SGIDand Sticky bit ?

hi there,

what is the reason/significance of using SUID, SGID and Sticky Bit ? the concept is not clear to me.

can anyone pls make me understand the concept of using those ?( if possible..with example ?)

Old 03-23-2006, 04:47 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
An example of a program that has the SUID bit set is "passwd". This allows a user to change their own password, which is stored in a file that is only writable by root.

The sticky bit is set on world writable directories. It prevents a user from deleting a file that they don't own.
The directory itself is a file, and since the directory is world writable, a user would otherwise be able to delete the file. An example is the /tmp directory.

ls /tmp -l -d
drwxrwxrwt 31 root root 1200 2006-03-23 04:37 /tmp

SGID programs will make your effective gid the same as the program. It is more usefull in a multiuser environment to allow access to files by all members of a group.

Last edited by jschiwal; 03-23-2006 at 04:53 AM.
Old 08-22-2012, 04:32 AM   #3
LQ Newbie
Registered: Jul 2010
Posts: 12

Rep: Reputation: 0

This link have explanation SUID, SGID and Sticky bit with examples. hope it helps you.
Old 08-22-2012, 06:56 AM   #4
Mr. Alex
Senior Member
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
I use SUID for "halt" and "reboot" so I don't need sudo before them.


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
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Suid bit behavior winsnomore Linux - Software 1 05-30-2004 03:49 PM
SUID file drops suid bit on append? c_coder Programming 1 03-12-2004 07:59 AM
Sticky Bit tarballed Linux - General 4 07-03-2002 03:54 PM
sticky bit motiram Linux - General 1 08-01-2001 12:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:34 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
Open Source Consulting | Domain Registration