Tried doing some research but can't really figure out the solution (or how to troubleshoot further) for this problem.

Objective and Reasoning for setting this up: SSH Tunnel RDP from work to home computer. At work, most ports are blocked, but I am able to use SSH.

Set-Up: Macbook Pro (at Work) --> Internet --> HomeModem --> SSHserver and Windows 10 Pro

I am able to connect directly to Windows 10 (from a friends house or local lan) without any issues. When I connect from WAN (not at work) I have port forwarding on my router at home setup for 338900 --> 3389 Windows 10 and 22 --> 22 SSHserver

I am able to connect to my SSHserver (Debian 8) from work and everywhere without any issues.

Attempts: From my mac I have tried:

ssh -p 22 -L 3400: root@WANIP | RDP: = no connection

ssh -p 22 -L 3400: root@WANIP | RDP: = no connection

ssh -p 22 -L 3400:WANIP:338900 root@WANIP | RDP: WANIP:3400 = no connection

All these attempts have been made from a WAN connection where I can just connect using: RDP WANIP:338900 = connection

Any direction and help is greatly appreciated.

  • What do you try to achieve? You need to connect from work to win10 via rdp? – ALex_hha Feb 20 '16 at 16:40
  • yes, I need to connect from work to home Win10 RDP but at work most ports are blocked so I wanted to try and set-up ssh tunnel for it as direct RDP connection does not work. – Omited Feb 20 '16 at 16:43
  • Can you connect from debian (ssh server) to win10? telnet 3389 – ALex_hha Feb 20 '16 at 16:48
  • telnet: could not resolve Name or service not known – Omited Feb 20 '16 at 16:50
  • between address and port must be space and not a colon – ALex_hha Feb 20 '16 at 16:52
ssh -p 22 -L 3400: root@WANIP

it's a correct command. I just checked in my environment. I have used the following command to create ssh tunnel

# ssh -L alex@WAN.IP -p 2222
# netstat -an | grep 3389
tcp        0      0  *                   LISTEN

After that I'm able to connect to via RDP.

On Debian you should check file /etc/ssh/sshd_config. There could be some restrictions

Match User alex
    X11Forwarding no
    AllowTcpForwarding no

On your mac you should check /etc/ssh/ssh_config for the same restrictions.

  • both ssh configs have x11 forwarding and allow tcp forwarding set to yes. not sure why but mine will still not connect. thank you for your help though! – Omited Feb 20 '16 at 17:49
  • got it. connected after using localhost:port instead of previously listed ip:port – Omited Feb 20 '16 at 18:01
  • Strange. Should work. I can only advise to run ssh -v (with debug option) and check the output. Perhaps there would be the answer. – ALex_hha Feb 20 '16 at 18:02

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.