【发布时间】:2011-08-23 12:41:44
【问题描述】:
是否有人可以使用工具来区分 RSA 公钥和 DSA 公钥?我有两个 SSH .pub 文件,我需要知道它们是 RSA 还是 DSA。
【问题讨论】:
是否有人可以使用工具来区分 RSA 公钥和 DSA 公钥?我有两个 SSH .pub 文件,我需要知道它们是 RSA 还是 DSA。
【问题讨论】:
您可以使用 ssh-keygen 获取指纹并从 .pub 文件中键入:
ssh-keygen -lf id_rsa.pub
【讨论】:
如另一个答案所述,由于该文件为 SSH.COM 格式,您可以转换为 openssh 格式并打开文件以检查 ssh-dsa 或 ssh-rsa:
To convert your SSH.COM key to OpenSSH format use:
ssh-keygen -i -f ssh_key.pub
From the ssh-keygen manpage
-i This option will read an unencrypted private (or public) key
file in SSH2-compatible format and print an OpenSSH
compatible private (or public) key to stdout. ssh-keygen
also reads the `SECSH Public Key File Format'. This option
allows importing keys from several commercial SSH
implementations.
-f Specifies the filename of the key file.
来源:http://landru.uwaterloo.ca/cgi-bin/wiki.pl?OpenSSH_-_SSH.Com_Interoperability
【讨论】: