# Tunnel VNC through SSH over Internet (Solved)

## keet

Edit:

My original purpose was to configure SSH so that I would be able to support Gentoo computers remotely.  I think that I have figured that out mostly, so now I am working on VNC.  I know that VNC is not a secure protocol, so I am working on tunneling it over SSH.  Here is my configuration:

On my Gentoo computer, I have a USB flash drive installation running OpenSSH (on an alternate port) and TightVNC (on a standard port).  On my Android telephone, I have ConnectBot and AndroidVNC.  Using ConnectBot, I connect to SSH (running on an alternate port) on my Gentoo computer.  ConnectBot also forwards port B to Gentoo:(the VNC port).  AndroidVNC connects to Android:B (127.0.0.1:B).

When I connect over SSH and VNC in my house, I see with Wireshark the traffic going to my computer's SSH port, and it works fine.  However, for some reason, when I try it over the Internet, it says "Establishing Handshake", but seems to time out after a minute or so, just saying "VNC Connection failed!".

I don't understand why internal SSH to VNC port forwarding works fine, but external doesn't.  Can anyone help with this?

More editing:

Using Wireshark, I found that when I connected on my "intranet", there was loopback traffic on the VNC port.  However, if I connected over the Internet, there was no lookback traffic.

I checked my firewall policy and found that I had blocked outgoing traffic on my VNC port.  When I enabled this, it worked.

But wait:  If I connect over VNC locally, there is no traffic on eth0 on my VNC port -- it's all on lo.  When I connect over the Internet, though, the VNC traffic is on eth0, not lo.  Why is this?  Does this mean that the VNC connection is not going over SSH properly?  I don't see how that could be, since my AndroidVNC doesn't even connect to anything external; it just connects to 127.0.0.1.  Will I just need to accept this, or is there something I can do to make my connection more secure?Last edited by keet on Thu Dec 30, 2010 12:04 am; edited 2 times in total

----------

## Crooksey

Is it failing just on one device? E.g. the phone, or can you connect over the internet with a desktop/laptop?

----------

## keet

 *Crooksey wrote:*   

> Is it failing just on one device? E.g. the phone, or can you connect over the internet with a desktop/laptop?

 

Thanks for your reply.  I think that I fixed at least part of the problem -- I edited my original post, and I think that the second part is the most important.

----------

## keet

There is no problem now.  I had configured ConnectBot incorrectly, forwarding the port to my computer's I.P. address instead of localhost.  I am happily typing this message to my home computer from work through SSH and VNC with my Nexus One.

----------

