I am trying to use Microsoft Remote Desktop client on Windows 10 to connect to a windows server 20xx in a data center through an SSH tunnel initiated from an SSH client on the windows 10 computer.

I recall circa the Windows XP era that I would need to specify to Microsoft Remote Desktop client when connecting to a remote RDP port tunneled through SSH.

I am running a clean install of windows 10 with all updates, and I am currently unable to do this. I tried variations of (etc), and changing the port number, but no luck.

I found this post: Probing a port for RDP

I tested this method from Linux first, and it worked, so I adapted the commands to the tools that come with git bash in git for windows:

echo -ne '\x03\x00\x00\x2c\x27\xe0\x00\x00\x00\x00\x00'\
'Cookie: mstshash=eltons\r\n'\
'\x01\x00\x08\x00\x00\x00\x00\x00' |
connect localhost 3390 |
xxd -p |
xargs -0 printf 'RDP response: %s\n'

This returns the expected response, so clearly the tunnel is working as expected.

I have also tried setting the hostname in Windows\system32\drivers\etc\HOSTS to maybe trick remote desktop, but putting the following in to remote desktop just spins and times out:


Did microsoft disable this altogether?

EDIT: Here is the relevant portion of the config that sets up the tunnel for SSH:

  localforward 3390
  localforward 3391
  localforward 3392
  localforward 3393
  • which is why I specifically asked so you've tried :p May 24 at 22:32

1 Answer 1


My fundamental issue was that I was setting up all remote access I needed at once for many hosts, and I skipped to the step where I set as the address in the HOSTS file, anticipating that windows RDP client would balk at Apparently, it now accepts So for my above example, works.

I am curious why or any other variation on that doesn't work. I regularly use those variations on linux if I need to see the fingerprint of the host's SSH key and have already accepted the fingerprint for

  • Windows can do funky things with the localhost addresses. And every new release of Windows seems to find other ways to break things. Anything other than is not guaranteed to work is my experience over 30+ years of wrangling Windows systems.
    – Tonny
    May 24 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .