Last active
March 15, 2017 22:53
-
-
Save frumpel/7dd07871f3c4664980068a37d06be13e to your computer and use it in GitHub Desktop.
AWS upload ssh key pair
This file contains 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
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