Skip to content

Instantly share code, notes, and snippets.

@madsonic
Last active January 21, 2020 15:31
Show Gist options
  • Save madsonic/a9bf8e0bbf0d1cf28d6a37bc1ecd06b9 to your computer and use it in GitHub Desktop.
Save madsonic/a9bf8e0bbf0d1cf28d6a37bc1ecd06b9 to your computer and use it in GitHub Desktop.
useful ssh configurations
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%C
ControlPersist 120
IdentityFile ~/.ssh/id_rsa
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%C
ControlPersist 120
ServerAliveInterval 120
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
Host bastion
Hostname bastion.com
# uses wildcard for host alias
# invoke subsystem proxy through proxy command
# i.e. ssh into 'some-proxy:8022' and call 'proxy' subsystem on some-proxy
Host *.example.com *.other.com
HostName %h
Port 22
ProxyCommand ssh -p 8022 %r@some-proxy -s proxy:%h:%p
# for proxy command sugar syntax
Host foo
ProxyJump bastion # same as using -W which is -N -T
Hostname example.com
Port 22
User ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment