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 port 65161, nchannels 4

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

  • As a troubleshooting step, try using rdesktop on the firewall machine to connect to the Windows machine. – Harry Johnston Nov 21 '11 at 20:40

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.)

  • 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 Nov 21 '11 at 19:50
  • Ah, right. Sorry, I overlooked that in your question! – squillman Nov 21 '11 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.