Ssh

VNC using an SSH Tunnel

To start the VNC server type:

$ vncserver
user$ vncserver
xauth:  file /home/user/.Xauthority does not exist
New 'example.com:1 (user)' desktop is example.com:1
Creating default startup script /home/user/.vnc/xstartup
Creating default config /home/user/.vnc/config
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/example.com:1.log

Your VNC port number will be 5900+.[[<<]]

In this case your port would be 5901.

To create the SSH Tunnel type:[[<<]]

$ ssh -L :localhost: -f -N -C user@example.com

In this case it would be:[[<<]]

$ ssh -L :localhost:5901 -f -N -C user@example.com

Using PuTTY

First start a new SSH connection to your server host and log in.

Attach:putty_change_settings.png

Then, left click on the program icon in the top bar -> Change Settings -> Connection -> SSH -> Tunnels.

Attach:putty_ssh_tunnels.png

Source port: [[<<]]

Destination: localhost: (localhost here represents the remote host)[[<<]]

Keep the Local and Auto radio buttons selected and click on Add.

Connect to localhost: using a VNC Client.

It may still show the warning saying "Uncrypted Connection" in the VNC Client when connecting to localhost: since it isn't aware of the SSH Tunnel.