Skip to content

Instantly share code, notes, and snippets.

@lharries
Created August 13, 2018 12:47
Show Gist options
  • Save lharries/8ceb2474e489dbee4398e959f2f3cbf6 to your computer and use it in GitHub Desktop.
Save lharries/8ceb2474e489dbee4398e959f2f3cbf6 to your computer and use it in GitHub Desktop.
Login to an aws ec2 using the ec2 instance id
ssh -i path/to/pem <ec2-instance-username>@`aws ec2 describe-instances --instance-ids <ec2-instance-id> --query 'Reservations[*].Instances[*].PublicIpAddress' --output=text`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment