# source: https://github.com/awdeorio/dotfiles/blob/master/.ssh/config-common
# archive: https://web.archive.org/web/20220327105524/https://github.com/awdeorio/dotfiles/blob/master/.ssh/config-common

# Common SSH configuration options that I use on many machines.
#
# To use them, first make sure you have ssh >= 7.0.  Then, edit ~/.ssh/config:
# > Include config-common

# Plain text host names in .ssh/known_hosts for Bash completion
HashKnownHosts no

# SSH multiplexing
# http://www.linuxjournal.com/content/speed-multiple-ssh-connections-same-server
# https://blog.flameeyes.eu/2011/01/mostly-unknown-openssh-tricks/
# https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing#Setting_Up_Multiplexing
#
# To avoid long file names when connecting to AWS: ControlPath ~/.ssh/master-%C
Host *
  ControlMaster auto
  ControlPersist yes
  ControlPath ~/.ssh/master-%r@%h:%p

# Jump host (example)
# https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/
# https://wiki.gentoo.org/wiki/SSH_jump_host
# Host *.eecs
#   ProxyCommand ssh -q trenton.eecs.umich.edu nc `echo "%h" | tr _ -` %p

# Jump host (example 2)
# https://blog.flameeyes.eu/2011/01/mostly-unknown-openssh-tricks/
# Host router.mycustomer.example.com
#   ProxyCommand none
# Host *.mycustomer.example.com
#   ProxyCommand ssh router.mycustomer.example.com -W %h:%p

# Alias for an IP address (example)
# Host alice
#   Hostname 10.8.0.30
