setuid root?

John Seth johnseth at phoenixwing.com
Fri Jun 13 22:58:45 EDT 2003


Using the symbolic method we have:

chmod u+s - set the setuid bit.
chmod g+s - set the setgid bit.
chmod u+t - set the sticky bit or directories

or numerically:

chmod 4777 - setuid and read/write/execute for everyone.
chmod 2777 - setgid and read/write/execute for everyone.
chmod 1777 - set sticky bit and read/write/passthrough on a directory.

You can, of course, add the numbers up to combine permissions:

chmod 6777 - setuid/setgid and read/write/execute for everyone.

When you list your files with ls -l, setuid will show up as an 's' where 
the owner's execute permission would be, setgid will show up as an 's' 
where the group's execute permission would be, and the sticky bit will 
show up as a 't' where the other's execute permission would be. So you'd 
see something like:

-rws--S--x 1 dmah staff 6335 Jul 12 09:49 my_script

The first 's' means setuid. The second 's' means setgid. And if the 
sticky bit was set, you'd see a 't' in the last position of the 
permission string instead on an 'x'. The second 's' is capitalized 
because the group does not have execute permission on the file. So 
without the setuid and setgid bits, the permissions would be 
read/write/execute for the owner and execute for everyone else, or 
(-rwx-----x).

So the above program would run as user 'dmah' when the server executed 
it and not as another user.



Scott Lawton wrote:
> On start up, I get a warning that says, 
> "Can't set real-time scheduling priority. 
> You need to run artswrapper as root or setuid root. " 
> 
> How, exactly, do I "setuid root" for artswrapper ?




More information about the nflug mailing list