Skip to content

Instantly share code, notes, and snippets.

@elijahboston
Created July 23, 2019 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elijahboston/97b4f4bfda74367199fb9fdc32a3c614 to your computer and use it in GitHub Desktop.
Save elijahboston/97b4f4bfda74367199fb9fdc32a3c614 to your computer and use it in GitHub Desktop.
SSH into an EC2 instance using a key file
# Usage:
# ec2 <ip/hostname>
ec2 () {
ssh -i ~/keys/mykey.pem ec2-user@${1}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment