Skip to content

Instantly share code, notes, and snippets.

@movii
Forked from ebirn/ssh_jumphost_config.txt
Created June 20, 2018 02:09
Show Gist options
  • Save movii/ce59d482126fdc79b87e60ccf9f30f65 to your computer and use it in GitHub Desktop.
Save movii/ce59d482126fdc79b87e60ccf9f30f65 to your computer and use it in GitHub Desktop.
ssh jump host forwarding config
#
# 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