View previous topic :: View next topic |
Author |
Message |
Fonzy n00b
Joined: 29 Apr 2008 Posts: 2
|
Posted: Tue Apr 29, 2008 5:27 pm Post subject: Restarting sshd via php & ftp |
|
|
Today I accidentally killed my sshd process. I don't have physical access to my server, so I can't go over there and reboot it. I am looking to either restart the ssh daemon or the entire server.
I can access my server via FTP (root access) and Apache is running with php capability. I figured out how to run programs via php as user Apache, but sudo is not installed, so it's hard to run a file as root.
Does anyone have any idea how to solve this problem? Thanks in advance. |
|
Back to top |
|
|
tarpman Veteran
Joined: 04 Nov 2004 Posts: 1083 Location: Victoria, BC, Canada
|
Posted: Tue Apr 29, 2008 8:10 pm Post subject: |
|
|
Fonzy wrote: | I can access my server via FTP (root access) |
Could you trick it into running a cron job? For example, uploading a script to /etc/cron.d/hourly? _________________ Saving the world, one kilobyte at a time. |
|
Back to top |
|
|
Fonzy n00b
Joined: 29 Apr 2008 Posts: 2
|
Posted: Tue Apr 29, 2008 8:20 pm Post subject: |
|
|
Will try uploading something, it'd just have to be a bash script with something like
Code: | /etc/rc.d/sshd restart |
right ?
Although I'm not sure if I got cron running. But will try, thanks for the idea ! |
|
Back to top |
|
|
tarpman Veteran
Joined: 04 Nov 2004 Posts: 1083 Location: Victoria, BC, Canada
|
Posted: Tue Apr 29, 2008 10:17 pm Post subject: |
|
|
If it's Gentoo, then it's /etc/init.d/sshd restart, but yes, that's the idea. Don't forget to set it executable. _________________ Saving the world, one kilobyte at a time. |
|
Back to top |
|
|
|