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

查看:36
本文介绍了如何将使用 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天全站免登陆