如何从公共密钥或MD5指纹中得出SHA256指纹?

发布于 2025-02-07 12:12:23 字数 436 浏览 2 评论 0 原文

我从需要连接到SFTP的人那里收到了由“ SAP SuccessFactors”生成的公共密钥,但是为了使我导入公共密钥,我需要提供SHA256指纹。

显然,“ SAP SuccessFactors”只能产生MD5指纹。我已经尝试运行该命令

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

,但我有一个错误

facekeyname.pub不是公共密钥文件

打开公共密钥文件的公共密钥文件,标题说,

 begin ssh2 public key

而我习惯于看到SSH-RSA的线条。

事先表示歉意,如果这似乎立即显而易见,但我会真诚地感谢一些指导或建议。

非常感谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

大姐,你呐 2025-02-14 12:12:23

您可以使用ssh-keygen。首先,您需要首先将文件转换为PEM格式

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

,然后可以从中获得SHA256值:

ssh-keygen -lf NEWpubkey.pem

有关参考,请参阅此帖子:获取公共密钥的sha256 hash

编辑:对于酒吧文件,这可以工作 ssh-keygen -e sha256 -lf sample.pub 请参阅如何从Java中的SSH RSA公共钥匙中计算指纹?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文