BaseHTTPServer and priviledge separation?

Lee Harr lee at
Sat Jun 25 17:48:41 CEST 2005

> to use a port below 1000 on a Unix system one needs root priviledges.
> But it's dangerous to execute all of a script under those priviledges.
> Therefore I'd like to drop the root priviledges as soon as possible.
> (How) is this possible?

Are you sure you don't just want to use twisted?

It is a bit more complex to start, but for just serving
web pages it may actually be simpler. Plus you get a
lot of extra functionality built in (like dropping 
privelege and chroot).

Looking at the code for twistd, they use os.setuid
and os.setgid

More information about the Python-list mailing list