Skip to content

Instantly share code, notes, and snippets.

@EscVector
Last active February 17, 2022 19:21
Show Gist options
  • Save EscVector/772aa48b5498da29129787252b81681e to your computer and use it in GitHub Desktop.
Save EscVector/772aa48b5498da29129787252b81681e to your computer and use it in GitHub Desktop.
# https://docs.aws.amazon.com/cli/latest/reference/ec2/import-key-pair.html
# aws ec2 delete-key-pair --key-name "cldr"
ssh-keygen -t rsa -C "cldr" -b 4096 -f cldr -q -N ""
mv cldr cldr.pem
aws ec2 import-key-pair --key-name "cldr" --public-key-material file://cldr.pub
rem # https://docs.aws.amazon.com/cli/latest/reference/ec2/import-key-pair.html
rm cldr.pem
rm cldr.pub
ssh-keygen -t rsa -C "cert" -b 2048 -f cert -q -N ""
mv cert cert.pem
cmd /c aws ec2 delete-key-pair --key-name "cert"
cmd /c aws ec2 import-key-pair --key-name "cert" --public-key-material fileb://cert.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment