0

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 127.0.0.2:3389 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 127.1.1.1 (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:

REMOTESERVER:3390

Did microsoft disable this altogether?

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

  #REMOTEDESKTOPS
  localforward 3390 10.0.0.111:3389
  localforward 3391 10.0.0.121:3389
  localforward 3392 10.0.0.122:3389
  localforward 3393 10.0.0.123:3389
1
  • which is why I specifically asked so you've tried 127.0.0.1:3390 :p May 24 at 22:32

1 Answer 1

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 127.0.0.2 as the address in the HOSTS file, anticipating that windows RDP client would balk at 127.0.0.1. Apparently, it now accepts 127.0.0.1. So for my above example, 127.0.0.1:3390 works.

I am curious why 127.0.0.2 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 127.0.0.1.

1
  • 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 127.0.0.1 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 .