如何将使用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)

查看:363
本文介绍了如何将使用PuttyGen(Windows)生成的SSH密钥对转换为由ssh-agent和KeyChain(Linux)使用的密钥对,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 PuttyGen 生成密钥对,并使用 Pageant 登录,因此我必须输入我的通行短语只有一次,当我的系统启动。

我如何在Linux中实现这一目标?我听说过 keychain ,但我听说它使用了不同的密钥对格式 - 我不想更改我的Windows密钥,如果我可以无缝地在Windows和Linux中以相同的方式连接。

解决方案

puttygen 支持将您的私钥导出为OpenSSH兼容格式。您可以使用OpenSSH工具重新创建公钥。


$ b


  1. 打开PuttyGen

  2. 单击Load

  3. 加载您的私钥

  4. 转至转换 - >导出OpenSSH key

  5. 将您的私钥复制到〜/ .ssh / id_dsa (或 id_rsa ssh-keygen

    $ b来创建RFC 4716版本的公共密钥
    $ b

      ssh-keygen -e -f〜/ .ssh / id_dsa> 〜/ .ssh / id_dsa_com.pub 


  6. 将公钥的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.

  1. Open PuttyGen
  2. Click Load
  3. Load your private key
  4. Go to Conversions->Export OpenSSH and export your private key
  5. Copy your private key to ~/.ssh/id_dsa (or id_rsa).
  6. Create the RFC 4716 version of the public key using ssh-keygen

    ssh-keygen -e -f ~/.ssh/id_dsa > ~/.ssh/id_dsa_com.pub
    

  7. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆