Re: [PROBLEM] Killed sshd, want to start it via PHP script.
| From: | Simon Fredriksson | Date: | Mon, 11 Aug 2003 13:14:06 +0000 |
| Subject: | Re: [PROBLEM] Killed sshd, want to start it via PHP script. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159133@lists.php.net to get a copy of this message | ||
Yeah, but as it is, I can't start those things :P
I must be root to do so. Apache is not running as root.
//Simon
Jason Wong wrote:
> 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.
>