Click to See Complete Forum and Search --> : Exec commands from a webpage


nerve
04-23-2004, 01:52 PM
I am trying to figure out how to exec system commands from a web page by calling a cgi perl script - the problem I am having is that it seems I can only exec as the web services user and I need to be exec'ing as root (Yes I am aware of the security implications of this).

Any ideas on how to either SU in the script or otherwise overcome this problem?

As an example I would like to restart sendmail using the following command from a button on a website:

/etc/rc.d/init.d/sendmail restart

Which requires I be root.

silent11
04-26-2004, 07:43 AM
download and take a look at the source of webmin. It does a buch of sysadmin tasks from a web interface. Webmin also allows you to do tasks/issue commands as root.

http://www.webmin.com/