Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what are suid and sgid

Status
Not open for further replies.

newtounix

MIS
Jan 22, 2002
4
US
I try to understand how suid and sgid work. I think SUID and SGID are the types of permissions that authorized a non-owner of that file to have execute permission. I would like to learn in more details how it works, such as how to set the permission bits, etc.

Nice day
Mary
 
Have you looked at the man pages for chmod, setuid, setgid and (for interest), sticky?

Greg.
 
suid and sgid allows a user to execute a file under the id of which the siud bit is set. For example, a suid shell script owned by root would look something like this.

# ls -l major_nono.ksh
-r-sr-xr-x 1 root sys 0 Jan 23 18:03 major_nono.ksh

since this has execute permissions set for the world (anyone can run this) as well as the suid bit set, what it means is that any users can run this script, and it will run as root. This is a BIG security concern.

I would suggest using sudo instead of suid bits if at all possible, especially in a shell script.

crowe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top