Skip to content

Instantly share code, notes, and snippets.

@l2ol33rt
Created May 19, 2015 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l2ol33rt/f4041a1abdff5efee53d to your computer and use it in GitHub Desktop.
Save l2ol33rt/f4041a1abdff5efee53d to your computer and use it in GitHub Desktop.
SSH Config Sample 1

Overview

This config allows you to connect through jumphost1 to the instance behind-jumphost1. It establishes a control socket that is persistent for 10m after disconnecting. If you connect multiple times to behind-jumphost1 the existing TCP connection will be used for additional sessions.

For more information take a look at: http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts

Host jumphost1
User mctesterson
HostName 192.168.80.10
ControlPath ~/.ssh/controlmasters/%r@%h:%p
ControlMaster auto
ControlPersist 10m
Protocol 2
Host behind-jumphost1
User mctesterson
HostName 192.168.88.20
ControlPath ~/.ssh/controlmasters/%r@%h:%p
ControlMaster auto
ControlPersist 10m
Protocol 2
ProxyCommand ssh jumphost1 -W %h:%p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment