我怎么知道我的ssh密钥是多少位?


98

过去某个时候,我已经为自己创建了一个ssh密钥。我不记得它是“多少位”。我怎么知道?

我想知道,因为我正在Nearfreespeech.net使用托管,而他们的常见问题说:

我可以将ssh连接配置为使用公钥吗?

...我们将不会安装长度小于1536位的密钥...我们希望您使用长度至少为2048位的密钥,如果要生成新密钥,建议的长度为4096位。


1
服务器故障上也有类似的问题。
Cristian Ciupitu

Answers:


144
[palvarez@oizon ~]$ ssh-keygen -l -f ~/.ssh/id_rsa.pub
2048 2e:8c:fd:aa:9f:95:86:9e:b0:d2:a6:1a:7e:d3:3e:74 .ssh/id_rsa.pub (RSA)

2048位。

说明:

  -l          Show the fingerprint of the key file.
  -f filename Filename of the key file.

1
像您的第二半一样,也许应该在打开联机帮助页之前已经阅读了两半:-)
Puggan Se 2013年

4
当您有SO时,为什么还要阅读联机帮助!不……但是真的……有时候,重要的部分隐藏在对晦涩的标志等过于复杂的解释中。同样,我也不会假设ssh-keygen可用于检查已经生成的文件。
Benji
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.