I want to connect my laptop and another machine together using synergy.
They are both on different networks, but I have successfully made a connection from my laptop to the desktop using an SSH tunnel through a publicly accessible machine on the desktop's network (Laptop -> Middle Machine -> Desktop). However, I would like to have the connection the other way round, Desktop -> Laptop. There is not a publicly accessible machine on my laptops network.
Can I run a command on my laptop which connects to the middle machine which opens a port tunnelling back to my laptop? My laptop is running Ubuntu, the other two machines are running CentOS.
Thank you
If you have a Middle Machine somewhere on the Internet where you can SSH into it both from Desktop and Laptop (the machines don't need to be on the same network at all), you can forward the traffic through Middle Machine quite easily:
See this answer on SuperUser on how to set this up (in that answer, Middle Machine is named
serverpc
, Laptop isofficepc
, Desktop ishomepc
). There is some extra network and CPU overhead due to the fact that you're running SSH-through-SSH, but it is surprisingly usable.All this can be done as normal user using vanilla SSH in default configuration. You can also use all the features of SSH in the final tunnel from Desktop to Laptop - SSHFS, X forwarding, agent forwarding, you-name-it.