SSH Private Key Credentials not working , Even though given the correct SSH Private key that got generated. getting the error "Adding target to blacklist. No valid credential found for types [SSH Password,SSH Private Key]"

krishna26
Kilo Expert

Hello Everyone,

To use in a custom SSH Activity, have created a SSH Private key credential by giving SSH Private Key that belongs to particular server.

I have created the SSH Private key Credential by following the below steps

1. By accessing the corresponding server, generated the corresponding RSA Private key along with the passphrase.

2. Opened the SSH Private Key Credential form, gave the encrypted Private key in the SSH Private Key field, Name of the Credential and saved the form (the Passphrase & Passwords fields got auto-populated).

3. When i am testing the credentials i am getting the error "Adding target to blacklist.  No valid credential found for types [SSH Password,SSH Private Key]" .

I seriously don't know what mistake have i done here !!!

On the other hand, created a SSH Credential record by filling the name, username & password fields. When tested the credential , i could see they are validated. 

I am attaching the screen shots of the respective credential forms & the corresponding ECC output & input queue records as reference.

Any help on rectifying this error would be greatly thankful.

 

Thanks & Regards,

Vamsi Krishna

1 ACCEPTED SOLUTION

Should authenticate the Private key created (copy the Public Key to authorized_keys)& Password Authentication in the Server should be no, then we the SSH Private Key Credential works

View solution in original post

8 REPLIES 8

Onkar Pandav
Tera Guru

Hi,

Please check below KB article that might be useful.

https://hi.service-now.com/kb_view.do?sysparm_article=KB0657528

varunk
Kilo Contributor

Hello Krishna,

 

Can you please try with complete private key? I mean, keep the top line (-----BEGIN RSA....) and bottom last line (----END RSA...) in private key. (as these were missing from snaps you shared.)

 

 

See if this helps.

 

Thanks,

Varun

Jon Runheim
Tera Contributor

Hi,
Please also note that the ServiceNow SSH only works with the SSH key types specified in the documentation:
SSH credentials (servicenow.com)
See the section SSH private key credential type for the field SSH private key. The types allowed are: RSA, DSA, or ECDSA. I.e. the private key must begin with one of the below:

-----BEGIN RSA PRIVATE KEY-----
-----BEGIN DSA PRIVATE KEY-----
-----BEGIN EC PRIVATE KEY-----

If it begins with

-----BEGIN OpenSSH Private Key-----
it will have to be changed to one of the approved variants instead.
The following link explains a bit about this:
ssh - Differences between "BEGIN RSA PRIVATE KEY" and "BEGIN OPENSSH PRIVATE KEY" - Super User
and how to convert it:
bash - Openssh Private Key to RSA Private Key - Stack Overflow

I hope it helps!
/ Jon

Even though ServiceNow claims that Open SSH is supported in the latest release (Xanadu) it still does not work and needs to be converted.