Re: [PROBLEM] Killed sshd, want to start it via PHP script.
| From: | Jason Wong | Date: | Mon, 11 Aug 2003 06:33:34 +0000 |
| Subject: | Re: [PROBLEM] Killed sshd, want to start it via PHP script. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159110@lists.php.net to get a copy of this message | ||
On Monday 11 August 2003 13:01, Simon Fredriksson wrote:
> Anyway; I want to make some sort of PHP backdoor to start sshd again. As
> far as I know, only root can do so though so just an exec() won't do.
> How can I switch to root, enter the password and then start sshd via a
> PHP script that I run via the web?
I know PHP is pretty versatile and all that, but I'm still amazed at the kinds
of things that people want PHP to do when there are better and more
appropriate alternatives:
The simplest requiring no more than a shell script is to run a cron job which
figures out whether sshd is running, if not start it.
Further up the scale you can use xinetd.
Even further, you can use something like daemontools to supervise your "must
run" daemons.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It is so very hard to be an
on-your-own-take-care-of-yourself-because-there-is-no-one-else-to-do-it-for-you
grown-up.
*/