[FRPythoneers] python scripts and setuid

Sean Reifschneider jafo at tummy.com
Sun Jul 15 18:11:38 MDT 2001

On Sun, Jul 15, 2001 at 10:27:57AM -0600, Ken Kinder wrote:
>I'm trying to write an administrative Fast/CGI script that needs to be
>executed as root. I don't want to use SuEXEC in Apache or CGIWrap -- I
>would much rather use setuid, but when put setuid permissions on the

suid on a script only works if the interpreter running it is suid.  You
probably don't want to do that with the Python interpreter.  It doesn't
have an su mode like perl.

The way I've done it for similar programs is to make the code that has to
have root privs be seperate from the CGI, then run it via popen() under
sudo.  Works fantasticly.

 Actual error message:  "Keyboard not connected.  Press F1 to continue."
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python

More information about the FRPythoneers mailing list