These are some notes on running Synergy over an ssh tunnel.

The problem: I use two computers at work. The one named Beavis runs Ubuntu, the other, named d73649, runs Win7. Each has its own monitor, mouse, and keyboard, but I prefer to use a single mouse and keyboard as much as possible. Synergy is a sweet piece of free and open software designed for just that purpose. With Synergy running, I can use the mouse to drag the cursor from one monitor to the other. The keyboard addresses the machine whose monitor the cursor is on, and I can copy/paste from one machine to the other.

Here’s the setup. I run the Synergy server, synergys, on Beavis, and the client, synergyc, on d73649. The server is configured via a single config file, ~/.synergy.conf. Mine looks like this:

section: screens
   beavis:
   d73649:
end

section: links
    beavis:
           right = d73649
    d73649:
           left = beavis
end

section: aliases
    d73649:
          d73649.myjob.com
end

Basically I am identifying the allowed client(s), and specifying that the monitor for Beavis is to the left of the monitor for d73649. The server is started by running the synergys command with no options. It runs in the background and listens for client requests.

The drill is to first start the server, then the client. I like to tunnel the Synergy traffic through ssh, to protect it from snooping. I do by starting the client with the following script.

#!/usr/bin/sh
## Connect windows box running synergy client to synergy server listening on port 24800.
## Windows machine has cygwin installed, and we are using the cygwin ssh client.
## Connection is tunneled through ssh to prevent snooping of keyboard traffic.

#------- FQHN of machine running the synergy server
server=beavis.myjob.com

#------- Location of syergy client on local box
#------- Note use of cygwin paths
client=/cygdrive/c/programs/synergy/synergyc.exe

#------- Either the ssh key should have no password set, or there should be
#------- an ssh agent configured to provide the password at execution time.
key=~/.ssh/frd_rsa

ssh -i ${key} -f -N -L localhost:24800:${server}:24800 ${server} && ${client} localhost

I leave the connection running for days at a time. Works like a champ.

Other thoughts: Synergy works with Macs too. There are various gui's for configuration and running the client, but I have not tried them. You'll still need to have a mouse and keyboard on both machines, for dealing with reboots and times when the client session is locked. This is great software. It fills a specific need, and does so quite well.