VNC Over SSH Tunnel

 

VNC over Secure Shell (SSH) Tunnel 

Confige VNC on remote machine (edit /etc/sysconfig/vncserver; become user and run vncpasswd; start vncserver service). Establish connection via ssh to remote machine as follows (assumes vnc was configured to listen on port 1 (i.e. 5901) on remote machine):

ssh -L 5902:localhost:5901 remotemachine.example.com

This creates an ssh tunnel between port 5902 on the local machine to port 5901 on the remote machine.

Now when you want to connect to the remote machine using vnc, just try to connect to localhost:2.