Teamviewer alternative: How to get a Remote Desktop VNC connection via SSH over an intermediate server, avoiding firewalls
This blog post was published 10 years ago and may or may not have aged well. While reading
please keep in mind that it may no longer be accurate or even relevant.
Teamviewer-like products are so popular because they solve a real problem: To connect from one machine to another is not straightforward because we all use regular modems/routers to connect to the internet. These use NAT and are usually not set up for Port Forwarding. In layman’s terms this means: You can initiate a connection to ‘the internet’, but ‘the internet’ never can initiate a connection to you. This quandary has only one solution: an intermediary is needed. Teamviewer-like products all offer such intermediary servers. Data is never directly sent from one computer to the other. Data is passed through a server.
For this article, I’ve decided to make an image gallery so that you can see easier what is going on behind the scenes. Running just 4 commands will do the trick!
2023 update: This solution basically is just a workaround for the *ProxyJump* feature of OpenSSH (the `-J` switch). However, this was only [introduced in version 7.3](http://www.openssh.com/txt/release-7.3) in 2016, which at that point in time was still 2 years into the future. Even though this solution is no longer relevant, I'll leave this blog post online to show how hard it was to achieve some things back then at this frontier.
The following list and image shows the starting point of our scenario:
We are sitting in front of the computer called “sittinghere”.
We want to see the screen of the computer called “overthere”.
There is a server called “hopper” which runs an ssh daemon (sshd) listening on the standard port 22. Our data will ‘hop’ though there, hence the name “hopper”.
If you found a mistake in this blog post, or would like to suggest an improvement to this blog post,
please me an e-mail to michael@franzl.name; as subject
please use the prefix "Comment to blog post" and append the post title.