Using SSH Tunnel for VNC

You can excute a vnc session on a remote system providing only
ssh access by means of an ssh tunnel.

In this example we will run a vnc server on a remote
system using display 8 which uses port 5908. The default ":0"
display would use port 5900.


Create an ssh tunnel on your local system:

ssh -l fred -L 5908:localhost:5908 21.42.53.64

In this example the "-l fred" passes the user name.
This may not be necessary depending on your configuration.

On the remote system start a vnc server:

vncserver :8

If you did not specify a display you would observer the output
to determine what display was in use and set up the ssh tunnel
in order to use the appropriate port (display # + 5900).

On the local system start a vnc session:

vncviewer -shared localhost:8

The "shared" argument format is needed only if this is to be a
shared session and will vary depending on the vnc software used.