Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sample :

[[Server]] has two interfaces : iface1 and iface2 ;

  • iface1 only listens SSH
  • iface2 only listens HTTPS (my target)

Only [[SSHProxy]] is authorized to connect to [[Server]]:22

diagram :

:iface2(listen 443) [[Server]] :iface1(listen 22) <-----> [[SSHProxy]] :iface1(listen 22) <-----> [[MyStation]]

QUESTION ==> How to forward locally [[Server]]:iface2(443) on [[MyStation]] in 1 ti in ssh_config, with nc or "-w" option in SSH ??

Actually I do it in two times :

  1. From [[MyStation]] : ssh user@[[SSHProxy]]

    Then on SSHProxy : ssh user@[[Server]] -L8443:iface2:443

  2. From [[MyStation]] : ssh user@[[SSHProxy]] -L8443:

I'm looking for a faster way...

Thanks a lot !

share|improve this question
Your question is frankly painful to read -- Please take a few minutes and rework it so the formatting is nicer and what you are asking is ore clearly stated. Full, complete, formal English sentences are encouraged. Take a look at some highly-voted questions and our Markdown editing help for some pointers. – voretaq7 Jan 9 '13 at 21:04
up vote 0 down vote accepted

Config file could be something like

$ cat .ssh/config 
   Host Server
         HostName [[Server]]
         User [[Server_user]]
         LocalForward 8443 iface2:443
         ProxyCommand ssh -W %h:%p [[SSHProxy_user]]@[[SSHProxy]]
share|improve this answer
Excellent dchirikov :) Thanks a lot ! – Steph Jan 10 '13 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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