我正在尝试使用以下命令生成一个新的密钥对
ssh-keygen -t rsa -f id_rsa
根据手册页,-t
参数应指示密钥的格式:
ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa] [-N new_passphrase] [-C comment] [-f output_keyfile]
[...]
The type of key to be generated is specified with the -t option. If invoked without any arguments, ssh-keygen will generate
an RSA key.
[...]
-t dsa | ecdsa | ed25519 | rsa
Specifies the type of key to create. The possible values are “dsa”, “ecdsa”, “ed25519”, or “rsa”
但是,该命令仍会输出具有较新ed25519
格式的密钥:
$ head id_rsa
-----BEGIN OPENSSH PRIVATE KEY-----
[...]
如何生成正确的 RSA 类型密钥?