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

查看:61
本文介绍了如何将使用PuTTYgen(Windows)生成的SSH密钥对转换为ssh-agent和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.

  1. 打开PuttyGen
  2. 点击加载
  3. 加载您的私钥
  4. 转到Conversions->Export OpenSSH并导出您的私钥
  5. 将您的私钥复制到~/.ssh/id_dsa(或id_rsa).
  6. 使用ssh-keygen

  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

  • 将公用密钥的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屋!

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