-1
1
There are several questions on SuperUser about how to allow a Remote Desktop connection from a Windows Computer to another Windows Computer through an ssh tunnel like this:
- ssh: local Windows -> putty -> ssh server
- Remote Desktop: local Windows -> ssh tunnel -> ssh server -> remote Windows
I have done this before and it works fine.
What I want to do now is slightly different:
I want to connect to a remote Windows computer through an ssh connection initiated by that remote computer.
- ssh: remote Windows -> putty -> ssh server
- Remote Desktop: Local Windows -> ssh server -> ssh tunnel -> remote Windows
Unfortunately I cannot figure out what exactly I need to configure to get an ssh tunnel that I can use this way.
It's not clear to me exactly what you want. Are you saying you want to somehow have the remote computer SSH into your local computer and set up a tunnel so that you can then RDP from the local computer to the remote computer via that tunnel? – kicken – 2019-08-24T19:13:39.563
I want the remote computer ssh into a linux ssh server in my LAN. It should set up a tunnel that I can then use to connect to it via Remote Desktop from my local computer. – dummzeuch – 2019-08-25T10:24:18.880
Does your local computer run SSH server? – Martin Prikryl – 2019-08-25T10:27:33.480
No, it's not even always the same computer. I might want to connect to the remote computer from any Windows computer on the LAN. That's why I want to use an (existing) ssh server running on a Linux computer as intermediary. – dummzeuch – 2019-08-25T11:18:28.353
Ok, see my updated answer. – Martin Prikryl – 2019-08-25T12:47:29.080
You could setup a script on the remote server to establish the tunnel, but you'd need a way to trigger the script still. – kicken – 2019-08-25T17:03:17.873
@kicken Yes, exactly. You need an agent there to open the tunnel. – Martin Prikryl – 2019-08-26T06:38:00.090