September 20, 2020

Secure VNC Connection Using SSH Tunneling In Linux

vnc logoWith the increase in malware and viruses the data sent over the network can be read quite easily. To make the connections more secure ssh was introduced (SSH- Secure Shell). The data sent over an ssh connection is encrypted and cant be read by any malicious script or a hacker.

VNC is a remote desktop tool which allows quick and easy sharing of screens across networks. The initial phase of connection establishment in VNC is secure, but when the connection is established the all data sent is unencrypted.

There is a trick called ssh tunneling to secure and protect data. When a SSH connection is established it forms like a tunnel all encrypted data flows through this tunnel.  We can force the VNC to use a SSH Tunnel to make the connection more secure.

Step By Step How to Secure VNC Connection using SSH Tunneling.

Step1.) Open a terminal and type

ssh -L 5900:localhost:5900 username@remote.server.address


ssh — the command

-L — To bind the port and address.

5900:localhost:5900 — uses port 5900 at the localhost from where the vnc session is originating the second 5900 defines the port number the destination

username@remote.server.address — is the username and password at the remote vnc site.

Now once you establish a secure SSH session you can use any vncviewer on your system to access the remote vnc server. All the data  now transmitted will be secure as ssh has formed a tunnel on port 5900 which is used by the VNC for connection.

Here is visual how to Secure VNC Connection Using SSH Tunneling In Linux, I am using ubuntu linux on both my boxes because I just love ubuntu.

I entered the following command on the terminal.

Now it will prompt for a password, enter the password and a secure ssh tunnel has been established.

Now navigate to the vnc viewer.

Type in the server address of the vnc server.

after this you can see the vnc screen.

screen VNC Connection Using SSH Tunneling In Linux

Akash Deep Singh

|| Eat Packets || Drink Management || Sleep Virtual || Work Linux || Think I.T. || Love MAC || Look After Windows || Dream APPS ||

View all posts by Akash Deep Singh →

Leave a Reply

Your email address will not be published. Required fields are marked *