With 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 firstname.lastname@example.org
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
email@example.com — 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.
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.