Last active
October 18, 2016 19:23
-
-
Save dliggat/0d62ace969419af64cb8dd55e73954f4 to your computer and use it in GitHub Desktop.
SSH into a private subnet via a 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
Host buildserver # bastion | |
HostName 50.123.123.123 | |
User ec2-user | |
ForwardAgent yes | |
IdentityFile /Users/dliggat/.ssh/key.pem | |
Host buildagent # tunnel ssh through a bastion | |
HostName 10.0.0.100 | |
User ec2-user | |
IdentityFile /Users/dliggat/.ssh/key.pem | |
ProxyCommand ssh buildserver -W %h:%p | |
StrictHostKeyChecking no | |
LocalForward 127.0.0.1:8080 10.0.0.100:8080 | |
Host buildagentweb # forward port 8080 to access web | |
HostName 50.123.123.123 | |
User ec2-user | |
IdentityFile /Users/dliggat/.ssh/key.pem | |
StrictHostKeyChecking no | |
LocalForward 127.0.0.1:8080 10.0.0.100:8080 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment