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 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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest