使用 Putty 转换 Couldn’t load private key (unrecognized cipher name)

我们在使用 SourceTree 的时候,如果使用连接,要把id_rsa转成ppk格式,添加到 Pageant 中使用,但转换中可能会提示

Couldn’t load private key (unrecognized cipher name)

Because your server tries to perform the conversion using an older PuTTYgen version which doesn’t support this format yet, you need to tell ssh-keygen to output keys using the older “PEM” format:

1
2
3
# ssh-keygen -t rsa -m PEM
# 上面的SHA-1签名在2021年9月GitHub中好像不再支持,使用
ssh-keygen -t ed25519 -m PEM

Or convert an existing key using the “password change” mode:

1
ssh-keygen -p -f ~/my_id_rsa -m PEM

Finally, you could also install PuTTY on your own system and use it to convert keys – if you get a sufficiently new version, it’ll recognize both ssh-keygen formats:

1
puttygen ~/my_id_rsa -o ~/my_id.ppk -O private