Remote desktop over SSH reverse tunnel to replace TeamViewer

Can you try doing the second step without doing the nc? That is - do the VNC with just the -L and -R. I believe the issue is that your netcat session is connecting back to an already open. So when doing the VNC stuff don't use netcat.


Instead of ProxyCommand, you should set "gatewayports yes" for your middleman sshd.conf.

  1. Then take remote tunnel from desktop to middleman and opening the tcp port x in middleman and vnc on local.
  2. Then take local tunnel from laptop to middleman opening vnc port to you localhost and tunneling it to x.
  3. Then connect to localhost:vnc, so it will go via local tunnel to middleman and remote tunnel to laptops vnc.

After you get it working, learn more about more secure settings of gatewayports.