Operating Systems > Linux and UNIX

apache help

(1/4) > >>

Stryker:
I am wanting to make a script (which is password protected of course) that will use the useradd command. Of course I need to be root to do this, but it's just stupid to run a webserver as root. Anyone know of a smart way i could go about doing this?

voidmain:
Not sure what you are getting at. Do you mean you want to write a CGI program so you can add a user through a web based interface? If so check out http://www.webmin.com/ and even though you start the web server (Apache) as root it spawn supprocesses that are run under the user "apache" with very limited capability. So you *really* aren't running the web server as root. If someone were to exploit a hole they would only get the limited privelages of the "apache" user.

Stryker:

quote:Originally posted by void main:
Not sure what you are getting at. Do you mean you want to write a CGI program so you can add a user through a web based interface? If so check out http://www.webmin.com/ and even though you start the web server (Apache) as root it spawn supprocesses that are run under the user "apache" with very limited capability. So you *really* aren't running the web server as root. If someone were to exploit a hole they would only get the limited privelages of the "apache" user.
--- End quote ---


I have webmin... that's not what i'm looking for though. i want to make my own script that will execute useradd as root. i hear suexec may work but i dont know anything about it

voidmain:

quote:Originally posted by Stryker:


I have webmin... that's not what i'm looking for though. i want to make my own script that will execute useradd as root. i hear suexec may work but i dont know anything about it
--- End quote ---


I haven't used suexec and I don't believe you can do root privelaged things, only privelages of other users. However, I have done similar things using a "system()" call in PHP to "sudo".

[ November 02, 2002: Message edited by: void main ]

Stryker:

quote:Originally posted by void main:


suexec is exactly what you would want to use under Apache. I believe it is much like "sudo" as far as how it works and it's configuration. I assume you'll want to use htpaccess/htpasswd to password protect the page, if so you might want to do the authentication over https. However, I have done similar things using a "system()" call in PHP to "sudo".

[ November 02, 2002: Message edited by: void main ]
--- End quote ---


I have htpasswd and a .htaccess to protect the page. But I have no idea how to use sudo or suexec... have any good links?

Navigation

[0] Message Index

[#] Next page

Go to full version