如何将使用PuTTYgen(Windows)生成的SSH密钥对转换为ssh-agent和Keychain(Linux)使用的密钥对 [英] How to convert SSH keypairs generated using PuTTYgen (Windows) into key-pairs used by ssh-agent and Keychain (Linux)
问题描述
我已使用PuTTYgen生成了密钥对,并已使用Pageant登录,因此,在系统启动时,只需输入一次密码.
I've generated key pairs using PuTTYgen and been logging in using Pageant, so that I have to enter my pass-phrase only once when my system boots.
如何在Linux中实现这一目标?我听说过keychain
,但是我听说它使用了不同的密钥对格式-我不想更改Windows密钥,如果我可以在Windows和Linux中以相同的方式无缝连接,那就太好了.
How do I achieve this in Linux? I've heard of keychain
but I hear that it uses a different key pair format - I don't want to change my Windows keys and it would be nice if I could seamlessly connect in the same manner in both Windows and Linux.
推荐答案
puttygen
支持将您的私钥导出为与OpenSSH兼容的格式.然后,您可以使用OpenSSH工具重新创建公钥.
puttygen
supports exporting your private key to an OpenSSH compatible format. You can then use OpenSSH tools to recreate the public key.
- 打开PuttyGen
- 点击加载
- 加载您的私钥
- 转到
Conversions->Export OpenSSH
并导出您的私钥 - 将您的私钥复制到
~/.ssh/id_dsa
(或id_rsa
). -
使用
ssh-keygen
- Open PuttyGen
- Click Load
- Load your private key
- Go to
Conversions->Export OpenSSH
and export your private key - Copy your private key to
~/.ssh/id_dsa
(orid_rsa
). Create the RFC 4716 version of the public key using
ssh-keygen
ssh-keygen -e -f ~/.ssh/id_dsa > ~/.ssh/id_dsa_com.pub
将公用密钥的RFC 4716版本转换为OpenSSH格式:
Convert the RFC 4716 version of the public key to the OpenSSH format:
ssh-keygen -i -f ~/.ssh/id_dsa_com.pub > ~/.ssh/id_dsa.pub
请参见此和
See this and this for more information.
这篇关于如何将使用PuTTYgen(Windows)生成的SSH密钥对转换为ssh-agent和Keychain(Linux)使用的密钥对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!