Understanding 'setuid'

Dan McGhee farmerdan at i-rule.net
Mon Apr 25 04:21:41 PDT 2005


One of the reasons I switch to Linux and am now using BLFS is that I 
wanted to know what was going on in the "bowels" of my PC.  The 
Package-User management system that Matthias Benkmann describes really 
does this (thanks Matthias) and I really like using it.

There are a number of instances in the "More Control and Package 
Management using Package Users" hint about setuid and when to use it.  
In fact PAM and the reinstall of Shadow really kicked my a??--er 
keyboard--this weekend because 'su' wasn't setuid--no it is and 
everything is fine.

In getting to this point in Linux, I've read many times something to the 
effect, "This needs to be setuid root."  And that this means that the 
"sticky bit" is set.  Beyond that I can't find anything.  What does 
"setuid" really mean?  What exactly does it do?  What does it cause?  
What does it prevent?

Would someone please point me in the direction of some good 
documentation on the subject or present their ideas here?

I think know that 'setuid' allows users and groups to access the file 
and that this is important for things like cd's, floppies and "the x 
system."

I'm in the study phase of installing Xorg and have just about talked 
myself into installing it as root rather than using the package 
management system--just because of the setuid issue.  (I don't think 
that Xorg is one of those little applications that I'll forget is 
installed. :) ).

Thanks,

Dan




More information about the blfs-support mailing list