Last active
January 1, 2019 06:00
-
-
Save li0nel/b01c21756f4c67bb514d076dd36de49a to your computer and use it in GitHub Desktop.
Connect to ECS instances in private subnets through a bastion
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
# Add your key to your SSH agent | |
ssh-add -K laravelaws.pem | |
# Verify that your private key is successfully loaded in your local SSH agent | |
ssh-add –L | |
# Use the -A option to enable forwarding of the authentication agent connection | |
ssh –A ec2-user@<bastion-public-IP-address> | |
# Once you are connected to the bastion, you can SSH into a private subnet instance | |
# without copying any SSH key on the bastion | |
ssh ec2-user@<instance-private-IP-address> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment