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