Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Restarting sshd via php & ftp
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Fonzy
n00b
n00b


Joined: 29 Apr 2008
Posts: 2

PostPosted: Tue Apr 29, 2008 5:27 pm    Post subject: Restarting sshd via php & ftp Reply with quote

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
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Tue Apr 29, 2008 8:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Fonzy
n00b
n00b


Joined: 29 Apr 2008
Posts: 2

PostPosted: Tue Apr 29, 2008 8:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
tarpman
Veteran
Veteran


Joined: 04 Nov 2004
Posts: 1083
Location: Victoria, BC, Canada

PostPosted: Tue Apr 29, 2008 10:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum