Setup an SSH tunnel for VNC
February 08, 2010 04:57:49 Last update: February 08, 2010 04:57:49
If you don't want to open an extra port for VNC or want extra security with SSH, you can setup an SSH tunnel for VNC. On Windows, you can do this with Putty or openssh.
Open a command window, and enter (using Putty as example):
When connecting with
If you use the setup frequently, it is more convenient to setup the tunnel as a Windows service. Assuming the name of the service is
Open a command window, and enter (using Putty as example):
C:\local\bin\plink.exe -ssh -2 -L localhost:5901:remote_host:5901 -l username -pw password remote_host -N
When connecting with
vncviewer, use localhost:5901 as server instead of remote_host:5901.
If you use the setup frequently, it is more convenient to setup the tunnel as a Windows service. Assuming the name of the service is
vnc_tunnel, the registry entry would look like:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\vnc_tunnel\Parameters] "Application"="C:\\local\\bin\\plink.exe" "AppDirectory"="C:\\local\\bin" "AppParameters"="-ssh -2 -L localhost:5901:remote_host:5901 -l user_name -pw password remote_host -N"