This is my synergy tunnel between my desktop and my laptop. Both are Ubuntu 14.04 LTS. Note that localhost is the desktop.

This works:

ssh -N -f -L 24800:localhost:24800 laptop

This doesn't (I could swear it used to!):

autossh -N -q -L 24800:localhost:24800 laptop

What am I hosing up here?


synergyc --debug INFO --no-tray -f --name Q localhost
2016-07-16T18:46:52 INFO: Synergy 1.4.12 Client on Linux 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC 2016 x86_64
Invalid MIT-MAGIC-COOKIE-1 key2016-07-16T18:46:52 WARNING: secondary screen unavailable: unable to open screen
Segmentation fault (core dumped)
  • what errors you get? – Jakuje Jul 16 '16 at 19:59
  • I haven't seen any. I'll try and get some. – user447607 Jul 16 '16 at 22:24
  • OK so based on the errors, I think this is about trying to log in before the user has logged into the GUI on the laptop. Display manager is lightDm. Also it seems to behave better with the -L spec as: – user447607 Jul 16 '16 at 22:50
  • What I don't understand is why, if I get an autossh session running, I can still start a regular ssh tunnel on the same ports. Those ports should already be open. This morning I come in and my ssh session is still alive. This suggests that autossh is maintaining the session but why didn't it start one in the first place? – user447607 Jul 17 '16 at 13:35
  • OK I've got this figured out. The problem was that the script was designed to start or restart synergy. To that end I was using sudo to kill synergy earlier in the script. That means that this script often gets executed from the command line as sudo. ...which changes the ${USER} variable I was passing to the sudo command ala sudo -u ${USER} to "root". I should have used ${SUDO_USER}. – user447607 Jul 17 '16 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.