LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Significance/reason of using SUID, SGIDand Sticky bit ? (https://www.linuxquestions.org/questions/linux-newbie-8/significance-reason-of-using-suid-sgidand-sticky-bit-427586/)

tofee 03-23-2006 04:07 AM

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 ?)


thanx..

jschiwal 03-23-2006 04:47 AM

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.

Techsystemquery 08-22-2012 04:32 AM

Toffe,

This link have explanation SUID, SGID and Sticky bit with examples. hope it helps you.

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

Mr. Alex 08-22-2012 06:56 AM

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


All times are GMT -5. The time now is 06:04 AM.