Last active
October 24, 2017 14:41
-
-
Save andytumelty/925329b0de65aa1ad5814554ebf1164b to your computer and use it in GitHub Desktop.
ssh config for use with bastion host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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