Created
January 5, 2016 20:09
-
-
Save mdaniel/512a98de7ae822eb40ed to your computer and use it in GitHub Desktop.
Create EC2 fingerprints for local PEM files
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
#! /bin/sh | |
# q.v. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#verify-key-pair-fingerprints | |
for i in "$@" | |
do | |
echo "== $i ==" | |
echo " if *AWS* generated the key, it's fingerprint will be:" | |
openssl pkcs8 -in "$i" -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c | |
echo " if *you* generated the key, it's fingerprint will be:" | |
openssl rsa -in "$i" -pubout -outform DER 2>/dev/null | openssl md5 -c | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment