如何将使用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
登录,因此我必须输入我的通行短语只有一次,当我的系统启动。
我如何在Linux中实现这一目标?我听说过 keychain
,但我听说它使用了不同的密钥对格式 - 我不想更改我的Windows密钥,如果我可以无缝地在Windows和Linux中以相同的方式连接。
$ b
- 打开PuttyGen
- 单击Load
- 加载您的私钥
- 转至
转换 - >导出OpenSSH
key - 将您的私钥复制到
〜/ .ssh / id_dsa
(或id_rsa $ c $使用
ssh-keygen
$ b来创建RFC 4716版本的公共密钥
$ bssh-keygen -e -f〜/ .ssh / id_dsa> 〜/ .ssh / id_dsa_com.pub
-
将公钥的RFC 4716版本转换为OpenSSH格式:
ssh-keygen -i -f〜/ .ssh / id_dsa_com.pub> 〜/ .ssh / id_dsa.pub
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.
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
supports exporting your private key to an OpenSSH compatible format. You can then use OpenSSH tools to recreate the public key.
- 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
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屋!