ssh to Windows server sitting behind Linux firewall

1

1

I have been looking everywhere and still can't get an answer. I am sorry if this is a re-post somehow.

I Have a home network setup as follows:

OUTSIDE -> Linux Firewall/Gateway -> Windows Server

I want to be able to create an ssh connection to my firewall and then start a remote desktop session with my Windows Server.

There are no other firewalls between the Windows machine and the Firewall. RDP works otherwise on the LAN

Here is the command I have been using so far:

ssh -v -L 13389:<Windows Server LAN IP>:3389 username@externalIP

That connects fine and I am greeted with my Firewall command prompt.

When I go to start an RDP connection to localhost:13389 I get the following error:

debug1: channel 3: new [direct-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 13389 for <WindowsIP> port 3389, connect from 127.0.0.1 port 65161, nchannels 4

I don't understand what the problem is, or what I am missing. Thank you all for your help!

Siriss

Posted 2011-11-21T18:58:57.350

Reputation: 282

As a troubleshooting step, try using rdesktop on the firewall machine to connect to the Windows machine. – Harry Johnston – 2011-11-21T20:40:24.743

Answers

0

When you say "localhost:13389" in your RDP session you're telling your remote desktop client that you want to connect to your own machine (unless you've done some non-standard remapping of localhost in your hosts file).

You'll need to use either the hostname or the IP address of the Windows server in your RDP connection.

(This is also assuming that your name resolution and routing are working properly in conjunction with your SSH session.)

squillman

Posted 2011-11-21T18:58:57.350

Reputation: 5 676

Thanks for the response. in my connection command: ssh -L 13389:<windowsIP>:3389 I am setting localhost 13389 to forward to connections on 3389 of the remote machine. I should then remote into local port 13389 to connect to <windowsIP>:3389. This has worked before without my Linux Firewall in place, but please explain if I am mistaken. Thanks again! – Siriss – 2011-11-21T19:50:16.233

Ah, right. Sorry, I overlooked that in your question! – squillman – 2011-11-21T19:59:07.600