[PROBLEM] Killed sshd, want to start it via PHP script.
| From: | Simon Fredriksson | Date: | Mon, 11 Aug 2003 05:01:47 +0000 |
| Subject: | [PROBLEM] Killed sshd, want to start it via PHP script. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-159101@lists.php.net to get a copy of this message | ||
Oops, I did it again!
Once again, I've managed to kill SSHd on my server. Hurray! >_<
What I want to do now, is make a script start it again. I could just reboot the machine the hard way or carry a monitor/keyboard there, but I don't wanna do that at 7am.
System: Linux Slackware 8.1
What I have and can access:
Apache + PHP 4.3.2
FTP
I got into this problem another time, just then the server was in a remote location but I managed to get a friend to drive me there and I started it blindfolded (no monitor, just keyboard). Then I called another friend while I was there to see if it got back up or not.
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'd appriciate your help.
//Simon