我正在尝试将 OpenSSH 生成的私有主机密钥转换为 PEM 格式,以便我也可以在dropbear-initramfs
.但是,当尝试使用该ssh-keygen
程序执行此操作时,我收到如下错误:
…# ssh-keygen -m PEM -e -f /etc/ssh/ssh_host_ed25519_key >/root/ssh_host_ed25519_key
do_convert_to_pem: unsupported key type ED25519
我该如何执行此操作?
答案1
事实证明,虽然-e
(出口) 选项失败,就地转换工作得很好。您可以执行以下操作:
…# cp /etc/ssh/ssh_host_ed25519_key /root/ssh_host_ed25519_key
…# ssh-keygen -m PEM -p -f /root/ssh_host_ed25519_key
Key has comment 'root@…'
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.