ARRR! Happy Talk Like a Pirate day.
In this scenario, we’re going to tunnel network traffic from a remote Windows box through a Linux firewall to the Windows desktop we’re currently using. The firewall of course has SSH enabled and functioning.
Before we establish a connection with PuTTY, we have to add tunnels for the services we want. The source port will be the local port we connect to and the destination will include the private IP and port number.
For example, let’s get connected to VNC (5900) and browse files (139) on our remote computer (10.0.1.20).
Note: In order for file sharing to work properly (obviously we’ve got file sharing turned on and configured on the remote end), we’ll need to stop two local services first. From a command prompt, type:
net stop “computer browser”
net stop server
Next, add the tunnel source/destinations like so:
Save, open the connection and login to the firewall.
The moment of truth! Run \\127.0.0.1\share_name. If all is well, you should be prompted to authenticate and after a short delay, see an Explorer window open with your files.
And to connect to the VNC service running on the remote host, connect like this:
Remember, these sessions are encrypted and tunneled through the Internet, so they’ll be much slower than if you were on the same network. But I think you’ll be pleasantly surprised.
Note: Remote Desktop (port 3389) does not work through a tunnel as Windows cannot connect to the localhost. You could experiment with the Microsoft Loopback adapter or run Terminal Services on alternate ports, but that seems like a real waste of time given that VNC is so easy to setup.