edit /etc/inittab and add line
ssh:345:respawn:/usr/bin/sshd

Then tell init to reread its configuration:
kill -1 1


Simon Fredriksson wrote:


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




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to