-1

I received a public key generated by "SAP SuccessFactors" from someone who needs to connect to an SFTP, but in order for me to import the public key, I need to provide a SHA256 fingerprint.

Apparently "SAP SuccessFactors" can only produce an MD5 fingerprint. I've tried running the command

ssh-keygen -lf <path>.fakekeyname.pub

but I get an error

fakekeyname.pub is not a public key file

In opening up the public key file, the header says

 begin ssh2 public key

whereas I'm used to seeing something along the lines of ssh-rsa.

Apologies in advance if this seems immediately obvious, but I would sincerely appreciate some guidance or advice.

Thanks very much!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

You can use ssh-keygen. First you would need to convert the file to pem format first

ssh-keygen -i -m PKCS8 -f pubkey.pem > NEWpubkey.pem
Next get the fingerprint

and then you can get the sha256 value from it:

ssh-keygen -lf NEWpubkey.pem

for reference see this post:get SHA256 hash of public key

Edit: For Pub files this could work ssh-keygen -E sha256 -lf sample.pub see How to Calculate Fingerprint From SSH RSA Public Key in Java?

DEFL
  • 907
  • 7
  • 20
  • Thank you! I assume though, that in the first instance of .pem you meant .pub? ssh-keygen -i -m PKCS8 -f pubkey.pub > NEWpubkey.pem – TechWorkerImposter Jun 15 '22 at 15:29
  • As per reference its for a pem file not pub file. Depending on your use case can you try to convert the pub file to pem format? – DEFL Jun 15 '22 at 15:54