Generate SSH Tunnel for VNC

in Categories: Linux, SSH, VNC.


By default VNC doesn’t use secure protocols when connecting. To securely connect to your server, you need to establish a SSH tunnel first.

When connecting your VNC client to your server, you might receive a warning message that says: unencrypted connection.

Create an SSH tunnel with the following command,

ssh -L 5901:localhost:5901 user@your-server-ip

Now instead of connecting your VNC client directly to your server (something like server.com:1), you need to use localhost:5901 to establish the connection.

If you still get the warning message, you can ignore that.

The client can’t know that the connection is being ssh tunneled, it knows only that when it talks to the declared server – localhost:5901 – it does so in plaintext, and it’s warning you about that. Since you have made arrangements for the traffic to be encrypted the rest of the way, you may continue in peace.

Source: serverfault .

Source(s):