In today's show we will talk about installing synergy so that you can
control the keyboard and mouse of another computer securely over
ssh.
Install synergy on both computers as root
# dnf install synergy
# apt install synergy
The main pc is pc_middle and it is the one with the
keyboard and mouse we intend to use for all the computers.
The only other pc in this configuration is, one on the right which we
call pc_right
On pc_middle create a configuration file. I put it in
~/etc/synergy-work.conf
section: screens
pc_middle:
pc_right:
end
section: links
pc_middle:
right = pc_right
pc_right:
left = pc_middle
end
On pc_middle add entry to ~/.ssh/config to
allow portforwarding back, for the synergy port
24800
Host pc_right
Hostname 192.168.0.150
RemoteForward 127.0.0.1:24800 127.0.0.1:24800 # send back from the client to me
On pc_middle run synergy server in the foreground with
debug enabled
[user@pc_middle ~]$ synergys --debug DEBUG --no-daemon --server --address 127.0.0.1 --config ~/etc/synergy-work.conf --name pc_middle --log /tmp/synergy-work.conf.log
[2022-12-03T16:29:05] DEBUG: opening configuration "~/etc/synergy-work.conf"
[2022-12-03T16:29:05] DEBUG: configuration read successfully
[2022-12-03T16:29:05] DEBUG: XOpenDisplay(":0")
[2022-12-03T16:29:05] DEBUG: xscreensaver window: 0x00c00001
[2022-12-03T16:29:05] DEBUG: screen shape: 0,0 5760x2160 (xinerama)
[2022-12-03T16:29:05] DEBUG: window is 0x05e00004
[2022-12-03T16:29:05] DEBUG: adopting new buffer
[2022-12-03T16:29:05] DEBUG: opened display
[2022-12-03T16:29:05] WARNING: LANGUAGE_DEBUG Poll result 0
[2022-12-03T16:29:05] DEBUG: registered hotkey ScrollLock (id=ef14 mask=0000) as id=1
[2022-12-03T16:29:05] NOTE: started server, waiting for clients
[2022-12-03T16:29:05] DEBUG: event queue is ready
[2022-12-03T16:29:05] DEBUG: add pending events to buffer
[2022-12-03T16:29:05] DEBUG: screen "pc_middle" shape changed
On pc_middle you can check that it's running
[user@pc_middle ~]$ netstat -anp | grep 24800
tcp 0 0 127.0.0.1:24800 0.0.0.0:* LISTEN 90859/synergys
On pc_middle you can connect to
pc_right
[user@pc_middle ~]$ ssh pc_right
user@pc_right:~$
On pc_right (either on its own keyboard, or via ssh
session from pc_middle), check that port 24800
is listening
user@pc_right:~$ netstat -anp | grep 24800
tcp 0 0 127.0.0.1:24800 0.0.0.0:* LISTEN
On the other keyboard that is connected to the pc_right
(see note below †)
user@pc_right:~$ synergyc --debug INFO --no-daemon --name pc_right 127.0.0.1
[2022-12-03T16:38:59] NOTE: started client
/build/synergy-3N7yN5/synergy-1.8.8-stable+dfsg.1/src/lib/synergy/ClientApp.cpp,404
[2022-12-03T16:38:59] NOTE: connecting to '127.0.0.1': 127.0.0.1:24800
/build/synergy-3N7yN5/synergy-1.8.8-stable+dfsg.1/src/lib/client/Client.cpp,146
[2022-12-03T16:38:59] NOTE: connected to server
/build/synergy-3N7yN5/synergy-1.8.8-stable+dfsg.1/src/lib/synergy/ClientApp.cpp,294
Back on pc_middle, you should see the the log that you
have connected
[2022-12-03T16:40:15] DEBUG: Opening new socket: 18FC73A0
[2022-12-03T16:40:15] NOTE: accepted client connection
[2022-12-03T16:40:16] DEBUG: received client "pc_right" info shape=0,0 5760x2160 at 2787,1371
[2022-12-03T16:40:16] NOTE: client "pc_right" has connected
† Note: If you tried to run the client syne