BaseHTTPServer and priviledge separation?

H

Helmut Jarausch

Hi,

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?

Many thanks for a hint,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
L

Lee Harr

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?
http://twistedmatrix.com/

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top