VNC over SSH - the linux one
To follow up my previous post, here are some simple steps for VNC connection over the SSH tunnel within the Linux environment.
Assuming your vnc server and ssh server are resided at the same machine, the server named gl818.net you want to have the connection. You need two xterms and two commands to accomplish this task.
At one xterm, type in the following command:
ssh -L 5902:localhost:5901 gl818.net
The above command means “Start an SSH connection to gl818.net, and also listen on port 5902 on my machine, and forward any connections there to port 5901 on gl818.net“.
Once the connection is established, fire up the following command at the other x terminal:
vncviewer localhost:2
As usual, you will be given a VNC Authentication window to key in your vnc password for the connection. That’s all you need to have the secure vnc connection.
References
http://www.cl.cam.ac.uk/research/dtg/attarchive/vnc/sshvnc.html