Created
August 13, 2019 21:13
-
-
Save cmackenzie1/aeac193a87d135c852373980cd02d393 to your computer and use it in GitHub Desktop.
SSH Tunnel / Bastion Hop config example
This file contains 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
Host * | |
AddKeysToAgent yes | |
UseKeychain yes | |
IdentityFile ~/.ssh/id_rsa | |
# Helps prevent timeout of connections due to inactivity | |
ServerAliveInterval 30 | |
TCPKeepAlive yes | |
# Use key forwarding so I don't have to put my private key on the servers | |
ForwardAgent yes | |
Host bastion | |
Hostname bastion.example.com | |
User ec2-user | |
IdentityFile ~/.ssh/id_rsa | |
ProxyCommand none | |
ForwardAgent yes | |
Host instance1 | |
Hostname instance1.vpc.internal | |
User ec2-user | |
IdentityFile ~/.ssh/id_rsa | |
ProxyCommand ssh bastion -W %h:%p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment