Saturn Technopark :: » Using plink to teleport VNC through firewalls

Portfolio


Using plink to teleport VNC through firewalls

It has been long since I really wanted to take control of some of our clients machines where we have our price software installed, and our technical and support team were using some sort of freeware or trial ware, which expired and threw us into dilemma.

This is when I tried the real-vnc, with plink. I knew it was possible some how. But how was the question. Finally after a bit of googling, and pouring over putty, plink manual, I came to the solution. And that is what I am going straight into. No technialities, and no theories, since I am unaware of the other facts as to how plink and its other switches work. Though the setup worked for us, it may not work for you and or there is no guarantee that this will work in any setup.

I actually identified a linux host where I could ssh into directly. And from the remote machine where VNC was running as a server, in the service mode, I issued the following in a cmd terminal

plink -R 5900:localhost:5900 user@hosted.linux.box

where the user stands for my login on the hosted.linux.box, which was the linux host colocated with our ISP. This sure asks for password, making this run from a batch mode ( -b), would need a key generation and upload of the same such that the password less authentication would happen.

Then on the desktop for support personnel I issued in a terminal,

ssh -L 5900:localhost:5900 user@hosted.linux.box

Once the password is accepted, this maps or forwards the port 5900 from localhost to the hosted.linux.box, which in turn is being forwarded to the remote machine internal port 5900 where exactly is VNC listening for incoming connections.

Then I start the terminal server client or vncviewer from the support machine, and point to localhost, which connects to the local end of the tunnel, which is drilled to the client’s machine where VNC is listening. My support team can happily view the desktop and give instructions on how to use the application. The VNC server is configured for accepting connections from localhost only, and since the tunnel is through ssh, we did not bother to setup a password.