Hi,
I'm attempting to accomplish a reverse RDP session. I've seen reports on the web that this can be done, but that it is harder when using XP SP2 or later as the thing you'd like to connect to. The set up I have so far is this...
PC 1 - WinXP SP2 machine behind a firewall
PC 2 - Internet facing Linux box with SSH
PC 3 - Windows Vista machine that I'm connecting from
So on PC 2 I've got option 'GatewayPorts' set to 'yes' in /etc/ssh/sshd_config and restarted the openssh daemon. Without it would just give PC 2 the ability to talk to PC 1 on 3389 over the tunnel, with this option turned on it gives PC 2 the ability to accept connections to it on 3389 externally and send them over the tunnel to PC 1.
On PC 1 I have grabbed the PuTTY Link program from... http://the.earth.li/~sgtatham/putty/latest/x86/plink.exe
And using a command like this...
plink -N -R 3389:localhost:3389 user@linuxbox.com
That basically says (in order) run plink, without any shell, forwarded a remote port locally, PC 2 should listen on 3389, and direct it's traffic to that hostname/IP (PC 1), and that port 3389 (on PC 1), and connect over SSH using that user, at that server address.
Now that works... to some extent. If you use the "Remote Desktop Connection" program on PC 3 to connect to PC 2 you will get the log in prompt for PC 1. Only problem is, when you've logged in with the right username/password (it knows if you haven't) then it pauses until it eventually times out.
Now I've heard this is perhaps a restriction added so that the terminal service running on PC 1 won't accept any connection that looks like it's coming from itself. I've tried the following versions...
plink -N -R 3389:localhost:3389 user@linuxbox.com
plink -N -R 3389:127.0.0.1:3389 user@linuxbox.com
plink -N -R 3389:127.0.0.2:3389 user@linuxbox.com
^^ I'm told that used to work before SP2
plink -N -R 3389:192.168.1.2:3389 user@linuxbox.com
^^ Internal IP of PC 1
plink -N -R 3389:pc1:3389 user@linuxbox.com
^^ PC 1's hostname
And they all did the same...
Now I'd have thought if I did forward port 3389 though the firewall PC 1 is behind (this is a test, obviously if I could do this in the environment I mean to use this idea - it would be useless) and use the external IP that PC 1 is using for it's internet access that it would work! But it doesn't... So maybe it'll never work, or maybe PC 1 is clever enough to know it's external IP and that it's the same as localhost.
Does anyone have any other ideas on what I can do to get any form of a reverse RDP connection working?
Thanks
Steven