Did not recognize PEM Header / Footer or unsupported algorithm

richard_torranc
Kilo Explorer

Hi, we are storing credentials on the MID Server for discovery. I am having trouble getting a SSH private key to work using the .properties file. I can get it to work if we use the credentials in service now but i'm not allowed to do that for security reasons.

The discovery log show the following error: SSHProtocolEngine SEVERE *** ERROR *** Private key decode failure: Did not recognize PEM Header / Footer or unsupported algorithm

I believe it's something to do with the way the key is formatted in the .properties file but i've tried several options without any joy. It does include the PEM header and footer but still no joy.

Any suggestions?

Thanks in advance

Richard

2 REPLIES 2

robertgeen
Tera Guru

Hello Richard,


What tool are you using the create the cert file? I've never done it in ServiceNow but I know with other tools I have used they are often very specific about the format and the tool that creates the key.




SSH private key credentials form


If you look at this page it references you need to create it using OpenSSH ssh-keygen utility tool which will put it in the PEM format.


The ServiceNow platform supports private keys in the PEM format generated by the OpenSSH ssh-keygen utility. To convert PPK keys that were generated by PuTTY:


  • Open your private key in PuTTYGen.
  • Export it in OpenSSH format from the menu Conversions > Export OpenSSH key.
  • Save the new OpenSSH key.


Hope this helps.


Hi thanks for your response. Yes we have followed the instructions in the documentation but still not working.