"Expecting: ANY PRIVATE KEY"

Michel michel.sales at online.fr
Sun Jun 27 23:02:46 UTC 2021

Hi Mariano,

My quick answer : your key file looks like an (old ?) custom *OpenSSH* format that *OpenSSL* cannot read natively.
You should easily find an OpenSSH command or other free tools to converts between formats.

Hope it helps,


-----Message d'origine-----
De : openssl-users [mailto:openssl-users-bounces at openssl.org] De la part de Mariano Gedisman-Córdoba via openssl-users
Envoyé : lundi 28 juin 2021 00:29
À : openssl-users at openssl.org
Objet : "Expecting: ANY PRIVATE KEY"

Hello everyone!
I have googled this error to no avail, but all answers don’t seem to adjust to my particular case, or maybe I’m too novice at figuring it out.

I have this key file:

[key here]

I’m trying to use this key in order to log in to my Google cloud instance through browser console, and I get the following error:
"Error: Failed to read key. The key file must be ECDSA or RSA in PEM format. "

I googled how to achieve this, and tried the following on my local machine:
$ openssl rsa -in id_rsa.txt -out id_rsa.pem -outform PEM

Sadly, I run into this error:
unable to load Private Key
56081:error:0906D06C:PEM routines:PEM_read_bio:no start line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/OpenSSL098/OpenSSL098-59.60.2/src/crypto/pem/pem_lib.c:648:Expecting: ANY PRIVATE KEY

As I said, Google did throw some clues, but nothing conclusive.
Note: I am running OS X El Cap.

Can anyone point out what am I doing wrong?

Thanks a lot in advance and I wish you a really good week!

More information about the openssl-users mailing list