In Approach, we have servers (ya, rly!). From time to time I need to access them. Usually, I do this by connecting to our VPN. At times, however, that is not possible, like for instance when some overzealous firewall administrator has blocked outgoing PPTP. Then you might have the need for an alternate approach, like using an SSH tunnel (provided that the administrator didn’t block outgoing SSH as well…)
And yes, I am aware that there are plenty of guides how to setup an SSH tunnel with Putty, but I found that they are either 1) overly verbose, 2) not exactly describing my problem or 3) wrong.
- I want to access a Windows Server using Remote Desktop
- There is a Linux server running in the same network section. Mine is running Ubuntu, so all examples will be in Ubuntuish.
- I have a Windows 7 client machine, with the Putty ssh client
On the Linux server
Make sure that SSH is installed (it probably is, otherwise, how do you access the server?). If not,
$ sudo apt-get install ssh.
Check that it says AllowTcpForwarding yes somewhere. If not, add it.
$ sudo /etc/init.d/sshd reloador
$ sudo service ssh reloaddepending on your Ubuntu version.
On the Windows client
- If you don’t have Putty yet, get it.
- Configure putty to connect to your Linux server using SSH 2.
Under Connection – SSH – Tunnels, map a local port to remote desktop on your Windows server. Usually, the remote port is 3389. The local port can be anything, except 3389 or 3390, which won’t work*.
- Save the session and connect to your linux server. You need to log on, and keep the connection open.
Open a remote desktop session to the source port on localhost.
* Because 3389 is probably already running a RDP server, and 3390 is blocked in Windows 7 for some reason.