Last active
July 25, 2018 10:42
-
-
Save ebirn/5604a1995d8813f04a6ce0f43ddfabbd to your computer and use it in GitHub Desktop.
ssh jump host forwarding config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# see also: | |
# https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing | |
# http://blog.scottlowe.org/2015/12/11/using-ssh-multiplexing/ | |
# | |
# you may want to use connection multiplexing on the jumphost | |
Host jump-host | |
Hostname jump-host.example.com | |
ForwardAgent yes | |
ControlPath ~/.ssh/cm-%r@%h:%p | |
ControlMaster auto | |
ControlPersist 10m | |
# this can also be chained, i.e. local->target_host->target_host2->... | |
Host target-host | |
ProxyCommand ssh -W %h:%p jump-host | |
# one-liner: | |
# ssh -o ProxyCommand="ssh -W %h:%p proxy_host" target_host | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use this in your client ssh config in ~/.ssh/config
the multiplexing will set up one persistent connection to the jump host (that will remain for up to 10 min when unused)
multiple hosts with ProxyCommand statement can be chained