Check If Private Key Is Malformed
I've Been Moving a Private Key Manually via the Terminal and I'm Getting an Error. I Suspect This Error Is Caused by Malformed Key. Is There a Way to Check If...
I've been moving a private key manually via the terminal and I'm getting an error. I suspect this error is caused by malformed key.
Is there a way to check if a key string is correct?
1 Answer
This question was already answered here and here
You can execute the following commands:
ssh-keygen -y -e -f <private key>
Takes a private key an prints the corresponding public key which can be directly compared to your available public keys. (Hint: beware of comments or key-options)
You can use also:
openssl dsa -in <private key> -modulus -noout
Display the public keys corresponding to a private key, then compare them.