Skip to content

Instantly share code, notes, and snippets.

@frumpel
Last active March 15, 2017 22:53
Show Gist options
  • Save frumpel/7dd07871f3c4664980068a37d06be13e to your computer and use it in GitHub Desktop.
Save frumpel/7dd07871f3c4664980068a37d06be13e to your computer and use it in GitHub Desktop.
AWS upload ssh key pair
KEYNAME=${KEYNAME:=defaultKeyPair}
## Generate a server cert
ssh-keygen -t rsa -b 4096 -f ${KEYNAME}
# Upload the key
aws ec2 import-key-pair \
--key-name ${KEYNAME} \
--public-key-material file://${KEYNAME}.pub
# Check that it worked
aws ec2 describe-key-pairs --key-names ${KEYNAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment