SSH Login w/ Terminal

Joined
Jun 21, 2006
Messages
54
Reaction score
0
Points
6
Your Mac's Specs
MacBook Pro Retina 15" 2.6GHz Intel Core i7, 8GB DDR3L RAM, 512GB SSD, NVIDIA GeForce GT 650M
Hey everyone;

Twice a day I need to login to an apache server using ssh and run a "restart_apache" command.

What I was hoping to find is a script that can log me in (username and password automated), run the command then log me out.

Can anyone help me out please.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Use ssh via rsa key-gen and then you can do something like..

ssh user@host 'command'

btw, why can't you just add restart_apache to crontab on the local machine?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top