LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-24-2004, 05:05 AM   #1
augustus123
LQ Newbie
 
Registered: Nov 2004
Location: kolakaran pettai
Posts: 7

Rep: Reputation: 0
what is "sticky bit mode" , "SUID" , "SGID"


Hi,

I was not able to understand the concept

sticky bit mode , SUID & SGID.

can any one help me in this??

Thanks
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-24-2004, 05:55 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
The sticky bit is represented by a t when you do ls -l. Its use is defined at http://www.unixguide.net/hp/faq/5.1.9.shtml. In general, it will stop the kernel from unloading the program from memory right after it's finished running (so subsequent runs of the program will be faster).

The setuid bit (s in the user column) allows an executable file, when run, to take on root privileges. You should only use this for programs designed to give up the privileges that they don't need right after they start.

The setgid bit (s in the group column) is the same as setuid, except that it takes on the root group permissions rather than the user. (In general, if you set setuid then you should also set setgid).

Last edited by rjlee; 11-24-2004 at 05:56 AM.
 
1 members found this post helpful.
Old 04-10-2006, 05:19 PM   #3
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 34
Hello augustus123,

There are some differences in the concepts stated by 'rjlee'.

1) Sticky bit was used on executables in linux (which was used more often)so that they would remain in the memory more time after the initial execution, hoping they would be needed in the near future. But since today we have more sophisticated memory accessing techniques and the bottleneck related to primary memory is diminishing, the sticky bit is not used today for this. Instead, it is used on folders, to imply that a file or folder created inside a stickybit-enabled folder could only be deleted by the creator itself. A nice implementation of sticky bit is the /tmp folder,where every user has write permission but only users who own a file can delete them. Remember files inside a folder which has write permission can be deleted even if the file doesn't have write permission. The sticky bit comes useful here.

2) As of SUID or SetUID bit, the executable which has the SUID set runs with the ownership of the program owner. That is, if you own an executable, and another person issues the executable, then it runs with your permission and not his. The default is that a program runs with the ownership of the person executing the binary.

3) The SGID bit is the same as of SUID, only the case is that it runs with the permission of the group. Another use is it can be set on folders,making nay files or folders created inside the SGID set folder to have a common group ownership.

Hope this was useful and you got the point.
 
3 members found this post helpful.
Old 02-22-2010, 04:35 AM   #4
lipun4u
Member
 
Registered: Sep 2008
Location: Mumbai, india
Distribution: ubuntu and hp-unix
Posts: 118

Rep: Reputation: 15
thanx

the info u hv given is really helpful...
 
Old 06-11-2010, 03:58 AM   #5
malyadri
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
what is the use of "SUID" , "SGID"
 
Old 06-11-2010, 04:19 AM   #6
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 34
malyadri, to know about these please read my post dated 04-11-06 and rjlee's post made at 11-24-04.
 
Old 09-17-2010, 06:08 PM   #7
chandranjoy
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Rep: Reputation: 0
The sticky bit is represented by a t when you do ls -l. Its use is defined at http://www.unixguide.net/hp/faq/5.1.9.shtml. In general, it will stop the kernel from unloading the program from memory right after it's finished running (so subsequent runs of the program will be faster).

The setuid bit (s in the user column) allows an executable file, when run, to take on root privileges. You should only use this for programs designed to give up the privileges that they don't need right after they start.

The setgid bit (s in the group column) is the same as setuid, except that it takes on the root group permissions rather than the user. (In general, if you set setuid then you should also set setgid).
 
0 members found this post helpful.
Old 12-21-2010, 12:51 PM   #8
kvmreddy
LQ Newbie
 
Registered: Aug 2009
Posts: 15

Rep: Reputation: 3
Check bellow link. Good explanation with an example. I am sure you definetly love it.
http://bashscript.blogspot.com/2010/...rmissions.html
 
1 members found this post helpful.
Old 10-12-2011, 05:52 AM   #9
sachingarg_ait
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
SGID,SUID,Sticky bit

Try this link it will help you in dealing with your problems

---------- Post added 10-12-11 at 05:53 AM ----------

Check this out it will help you
http://synapssolutions.in/?p=279
 
Old 10-12-2011, 08:58 AM   #10
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,377

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
So will the man command. Or, this really nifty web-site you may not yet have heard of.

Something else to be aware of is that, these days, the "setuid" and "setgid" bits may well be ignored, with the system using more sophisticated, rule-based algorithms to determine when programs may obtain either elevated privileges or altered identities. A single bit is too-easily overlooked.

"Sticky" is a now-obsolete concept that is almost always ignored.
 
Old 08-03-2012, 04:40 AM   #11
techguru666
LQ Newbie
 
Registered: Jul 2012
Posts: 24

Rep: Reputation: Disabled
Try this tutorial on SUID/SGID/Sticky bit:

http://www.expertslogin.com/linux-ad...bit-suid-guid/
 
  


Reply

Tags
bit, bits, sticky


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 6 03-21-2013 10:35 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM


All times are GMT -5. The time now is 11:18 PM.

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