Ubuntu – How to VNC using a SSH Tunnel from one Ubuntu box into another

puttysshssh-tunnelUbuntu

I'm new to SSH and Linux so please don't laugh if this is a simple question. I've looked and haven't really found anything using Google that does exactly what I want it to do.

Setup

Home LAN

Router
– Listening for Port 443
– Redirects anything on port 443 to Port 22 on "sshserver"

Ubuntu Server (Behind Router)
– name = sshserver
– openSSH installed. Ip address 192.168.2.2
– SSH listening on port 22
– System-Preferences-Remote Desktop – Enable – Password
– (Uncheck confirm each connection to this computer)

Outside my house

Ubuntu Desktop (name = workstation) with Putty installed. Obviously my IP address is dependant on where ever I am.

What I Can do now

I can ssh into my "sshserver" no problems using "Workstation". Everything is working great. I am connecting my Ubuntu "workstation" to "sshserver" using Putty.

What I have tried

I am under the understanding that when you check off "remote desktop" in Ubuntu, VNC will run on port 5900. Because I know the session screen page works (I can always successfully log in with SSH) I just want to just edit the Putty – ssh – Tunnel section.

On this scren I have tried entering:
source port: 5900
destination port: localhost:5092

The reason why I have done this is I have the intention of using Applications – Internet "remote desktop viewer" application. In it I tell it I want an VNC type connection and that I want to connect on "localhost:5092".

This fails miserably. I guess I am just not understanding exactly how the tunneling happens and how to correct this issue. If anyone could help me understand how this works using the tools I have listed I would be really thankful!

THanks in advance.

Best Answer

Enter in all the connection information on the main putty screen. Sounds like you will be using port 443 instead of 22 to connect from the outside. Then go to the Tunnels section and put in 5092 for the Source port. Put in localhost:5900 for the destination. Leave the radio buttons to Local and Auto. Click Add so it shows up in the list and then open up the connection

putty port forward config

When you open up the connection, you will have access to "localhost:5900" from the perspective of the server. You can access it from your local port 5092.

To connect to the server using vnc, plug in localhost:5092 for the host. enter image description here