Tuesday, April 16, 2019

AWS: Check if ec2 keypair private / public key matches

Hey all,

To validate if the ec2 SSH public key value you see in your AWS console matches a local private key, you can run the following command:


MacComputer:~$ openssl pkcs8 -in ~/.ssh/kyler_key.pem -nocrypt -topk8 -outform DER | openssl sha1 -c
fc:b2:e2:e2:1d:2c:4f:2b:78:e6:f4:21:f5:0d:9a:09:11:53:37:05

These two match! SSH auth will let me in.

Good luck out there!
kyler

No comments:

Post a Comment