Using SSH to Execute a Command on a Remote Machine
In my last post I had said that I had a batch file that I used to restart the service on windows and the process on Linux. Now I am going to show you how to do it. This should work on any machine that is running a SSH Server. It is assumed that the client machine already has an SSH client installed. I am using the OpenSSH client on Windows XP.
c:\openssh\bin\ssh -l username remotemachine
/dir/to/script/or/application
The -l allows you to pass the username that is needed to connect to the remote machine.
I created a script on the Linux box that will kill the Synergy process and then restart it to re-establish the connection to the server.