Skip to content

Instantly share code, notes, and snippets.

@andytumelty
Last active October 24, 2017 14:41
Show Gist options
  • Save andytumelty/925329b0de65aa1ad5814554ebf1164b to your computer and use it in GitHub Desktop.
Save andytumelty/925329b0de65aa1ad5814554ebf1164b to your computer and use it in GitHub Desktop.
ssh config for use with bastion host
# bastion host for env1
Host env1
Hostname 1.2.3.4
User laycat
ForwardAgent yes
# Same user, simple pattern matching, allows `ssh host1.env1.fq.dn` from local host
Host *.env1.fq.dn
User laycat
ProxyCommand ssh -q env1 -W %h:22
# Different user for host2, same user for bastion
Host host2.env1.fq.dn
User ubuntu
ProxyCommand ssh -q env1 -l laycat -W %h:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment