This little utility is known as synergy and is used for controlling multiple computers from one keyboard and mouse over any network. For more information on installation/configuration, please visit here.
Unfortunately, synergy comes with one noticeable caveat - no network traffic encryptie supportie. Guess we'll have to remedy that, won't we?
Now, there are plenty of blogs out there on the ol dub-dub-dub that describe how to enable network-based encryption for synergy using stunnel or openssh. Unfortunately, they typically present this with a solution that requires a series of scripts that live on the synergy server (synergys) and the synergy client (synergyc). If you're as serious about synergy as we are, you'll notice it gets a bit "twitchy" when you constantly find yourself having to disconnect/reconnect often...calling different scripts here and there, rubbish. Time to change all that :)
Today, you'll have the opportunity to learn how to connect your synergy clients to a synergy server all sourcing from one synergy server. This is all accomplished through our friend, OpenSSH and its reliable wingman, reverse tunneling.
Again, this all in one, easy shell script connects synergy clients to the synergy server from...you got it, the synergy server. That's right, no more annoying typing on this keyboard or that keyboard to get your synergy clients connected...clackity-click-clack. We heart that idea almost as much as we heart lock picking as a past-time in the shop. While you're thinking about lock picking in the shop, consider picking up this book...it's one of the better ones out there on lock picking:
Our apologies for the digression - back to the regularly scheduled program...here we go:
STEP 1: Okay, first you must setup key-based authentication for OpenSSH so that your synergy server can authenticate with the synergy clients without requiring a person to actually type a password (or at least a moderately sophisticated zombie robot).
STEP 1.1: Run the following command from your synergy server:
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<user>/.ssh/id_rsa):<PRESS_ENTER>
Enter passphrase (empty for no passphrase):<LEAVE BLANK, PRESS_ENTER>
Enter same passphrase again:<LEAVE BLANK, PRESS_ENTER>
Your identification has been saved in /home/<user>/.ssh/id_rsa.
Your public key has been saved in /home/<user>/.ssh/id_rsa.pub.
The key fingerprint is:
cc:d9:cb:d8:cd:24:ad:87:41:1c:57:90:14:73:00:fb user@hostname
The key's random art image is:
+--[ RSA 2048]----+
| ..+el... |
| . n... |
| . o . |
| . + * . |
| N O p e |
| = O |
| . * + |
| . |
| |
+-----------------+
STEP 1.2: Transfer the synergy server file, id_rsa.pub to your remote synergy client:
$ scp /home/<user>/.ssh/id_rsa.pub <user>@<remote synergy client>:/home/<user>/
STEP 1.3: SSH into your remote synergy client computer:
$ ssh <user>@<remote synergy client>
<user>@<remote synergy client> password: <TYPE PASSWORD>
STEP 1.4: Append the contents of id_rsa.pub to the authorized_keys file:
$ cat /home/<user>/id_rsa.pub >> /home/<user>/.ssh/authorized_keys
***At this point you should be able to authenticate to your remote synergy client from your synergy server machine. Please note that you also must ssh from the synergy server as the synergy server user that possesses the id_rsa.pub file within their "/home/<user>/.ssh" directory. Of course you ssh to the synergy client using the synergy client user that contains the authorized_keys file within their "/home/<user>/.ssh" directory. So far, so good.
STEP 2: The script...now, here comes the beautiful part. Create a file called onesyn.sh on your synergy server and paste the following:
#!/bin/bash
# onesyn.sh
# Start the synergy server daemon and sleep to ensure it's up
# prior to kicking off our uber-simple client initialization
synergys &
sleep 2
# now, reverse-ssh into synergy client using key-based auth
# and kick off synergy client over an encrypted network tunnel
ssh -R 127.0.0.1:24800:127.0.0.1:24800 <user>@<remote synergy client> "synergyc -f 127.0.0.1"
That's it folks! Simply save your file and make it executable by issuing the following command:
$ chmod 755 onesyn.sh
Have this script auto-run each time you authenticate with your favorite desktop environment (KDE, Gnome, etc.). Better yet, use your favorite window manager instead (OpenBox, FluxBox, FVWM, etc.) since desktop environments are made for people with an unhealthy amount of patience.
Logout, log back in, and enjoy your lavishly excessive array of flat-panel displays, crts, and computing devices all accessible and dominated from one keyboard and mouse! Yes, it's even okay to sit back, raise your hands towards the back of your head, and totally bask in your amazing awesomeness ;)
Kickin ass n chewin bubble gum. Later skaterz!
If you enjoyed this post, send us = kudos =
(Bitcoin Addr: 19n6q3GZfoM64oqv5HsDnhzqvcEvJUvmdx)
No comments:
Post a Comment