Using -W with -L (Local Forwarding) and -D (Socks Forwarding)

Thomas Glanzmann thomas at glanzmann.de
Sun Jul 31 21:36:54 AEST 2016


Hello,
I have in my ssh config:

Match host 2.3.4.5 exec "~/bin/connect.sh"
        ProxyCommand ssh -D 1080 -L8080:1.2.3.4:8080 -p 443 bouncehost -W %h:%p

~/bin/connect.sh:
#!/bin/bash

if echo | nc -w 1 2.3.4.5 22 | grep -q SSH; then
        false
else
        true
fi


So when I can't connect to the system directly it should go over a bounce host
but at the same time use a portforwarding which is only available from the
bouncehost but not the server itself. My problem is that -W clears all forwardings.
Is there another trick or option for example with -L that allows me to forward
stdin using a bounce host but let me specify additional forwardings?

For now I just go back to use netcat which works fine.

Cheers,
        Thomas


More information about the openssh-unix-dev mailing list