Synergy is an excellent program but does not provide encryption. This means that any passwords you send to your client machine are easily visible. However, Synergy works great with SSH tunneling and since I recently had to set this up myself hopefully I can help you do it too.
I am assuming that Vista is your server and OS X is your client; your Vista account must be administrator level. You may be able to use this info for pretty much any configuration. Sources for this article include my friend influx’s post about Powershell and SSH in Vista (used to point out a step I foolishly missed on the next source), pigtail’s OpenSSH/Cygwin Configuration Tutorial, and the Synergy Network Security Guide.
- Install and configure Synergy on both machines. Instructions can be found here.
- Configure Synergy for autostart. Instructions can be found here.
- Make sure you are starting Synergy when the system starts on both machines. For OS X use the first tutorial that describes a method for implementing options 1 and 2 as outlined on that page.
- Install and configure Cygwin/OpenSSH on the Vista machine. Use pigtail’s page.
- Note that steps 3 and 4 are in the same configuration window (lower portion). In Vista right-click ‘Computer’ then click ‘Properties’ and then ‘Advanced system settings’ and click through the annoying administrator warning (you’re already administrator, -sigh-).
- When using Cygwin you have to run it as administrator. Select and right-click the Cygwin shortcut (in c:\cygwin by default), click ‘Advanced…’ in the ‘Shortcut’ tab and check the ‘Run as administrator’ box (if there is no shortcut make one to point to cygwin.bat).
- When running ssh-host-config you most likely will not want to separate user privileges, this is easiest option. When it asks about making an sshd-server user answer ‘yes’, this is very important for this service to work as expected. The script should walk you through the specifics.
- I had some trouble with ‘net start sshd’. I did several things to try and fix this and I’m not sure what I did that worked (restarting does not work). Try running ssh-host-config again and allow it to rewrite the /etc/sshd_config file. Also try deleting the /etc/sshd_config file and then regenerating it with ssh-host-config (don’t forget to go back and change the port). If you figure out what works let me know so I can update this information.
- Edit /etc/sshd_config file and change the port if so desired for further security. Then uncomment ‘RSAAuthentication yes’, ‘PubkeyAuthentication yes’, and ‘AuthorizedKeysFile .ssh/authorized_keys’. This may be partial overkill since some of these are ok by default but better safe than sorry.
- Restart sshd (net stop sshd, net start sshd).
- Make sure you have a .ssh/ directory in your Cygwin user directory (if you’ve added anyone to your known_hosts you will have this).
- Setup SSH tunneling on OS X.
- In a terminal type ssh-keygen. This will generate an RSA key (if it doesn’t use ssh-keygen -t rsa instead).
- Type
scp -P #port .ssh/id_rsa.pub username@hostname:~/.ssh/authorized_keys
or do whatever is appropriate if you have more than one key. Change #port to the correct port number or drop the -P parameter altogether if you’re just using the default port.
- Edit /Library/StartupItems/Synergy/Synergy. Change the host-name you entered earlier to localhost. Then add the following line just below the first bracket in ‘StartService ()’:
sudo -u username ssh -f -N -L 24800:synergy-server:24800 synergy-server -p #port
Change synergy-server and port (unless using default port, then drop the -p entry) to suit your configuration. If you’re using a custom Synergy port then change the 24800’s. Note that this works but is something of a hack. If you have a more elegant solution for getting the tunneling going at startup let me know. Also note that you may need to add a username if your login is different.
- Edit /Library/StartupItems/Synergy/StartupParameters.plist and change OrderPreference to “Last”.
EDIT: I’ve noticed that the Synergy client doesn’t always log on to the server on startup. My solution thus far has been to continue to restart until it does (an inelegant solution at best) so I think there’s something messed up with the order OS X starts and how the script fits in with that. When I figure out a solution I’ll update this article.
EDIT: Fixed duplicated link. Updated with hopeful fix for startup issues. Also, when troubleshooting restarting the sshd server on the host machine can help, especially in cases of client reboot.