半亩塘闲话

半亩方塘一鉴开 天光云影共徘徊 问渠哪得清如许 为有源头活水来

putty ssh密钥转换成open ssh密钥

Shizhao发表于:2009年四月18日 | 分类: Geek, 互联网

在windows下生成密钥常用putthygen,但是生成的密钥是putty专用的认证文件,无法转到linux下使用。
在linux下,安装putty。然后输入以下命令转换出open shh的私钥格式:

puttygen id.ppk -O private-openssh -o outfile

id.ppk是putthygen生成的密钥文件,outfile是要转换成的open ssh格式的私钥文件

再如法炮制,生成公钥文件:

puttygen id.ppk -O public-openssh -o outfile.pub

ok。现在就已经把putty ssh密钥转换成open ssh密钥了。

参考:putty ssh文件到open ssh的转换

一个问题:如何用ssh密钥对自动远程登录呢?参考了这篇文章,可是每次ssh登录仍然需要输入登录密码。不知道如何解决?

分享:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • Furl
  • Print
  • TwitThis
  • Diigo
  • FriendFeed
  • PDF
  • RSS
  • Twitter

相关日志

Tag: , , ,

Creative Commons License《putty ssh密钥转换成open ssh密钥》 本文 by Shizhao is licensed under a Creative Commons 署名-相同方式共享 3.0 Unported License.



1 Other Comment

7人发表了评论  ↓发表评论↓
  • 啊冲 @ 2009年05月25日23:51 | 回复

    没那么复杂,直接用puttygen.exe加载putty ssh密钥,导出open ssh,上传,即可使用。

  • I Shed T h i r t y P o u n d s in Only a Month @ 2009年05月6日14:15 | 回复   More from author

    Hi, cool post. I have been pondering this topic,so thanks for sharing. I will definitely be coming back to your blog. Keep up the good work

  • 也许知道 @ 2009年04月27日13:35 | 回复   More from author

    你的http://twitter.com/shizhao被封了。打不开。

  • 怎样减肥 @ 2009年04月19日19:58 | 回复   More from author

    很强大,支持一下!!

  • 南 靖男 @ 2009年04月18日15:59 | 回复   More from author

    在 sshd_config 中强制指定 AuthorizedKeysFile %h/.ssh/authorized_keys
    然后,记得把 .ssh 目录设置为 700,authorized_keys 是 600,目录和文件属主是自己。
    authorized_keys 里面可以放多个 key,每个一行,要小心编辑器的自动换行保存(因为公钥开头有空格)。
    建议对于不同的用途使用不同的密钥,authorized_keys 文件里面是可以设置 options 的,详细可以看 http://www.eng.cam.ac.uk/help/jpmg/ssh/authorized_keys_howto.html (可以设置一个没有密码保护的密钥在指定IP的电脑自动登录自己的账户执行指定的命令)
    另外,公钥无所谓转换了,puttygen 中间显示的就是公钥,ssh-keygen -y 也可以显示私钥的公钥。

  • geektang @ 2009年04月18日10:55 | 回复   More from author

    你用key登陆ssh还需要密码,是因为你生成这个key的时候,输入了 passphrase

    这个密码不是ssh服务器的密码,而是你这个key的密码,感觉有点绕,不知道你理解了没有

    如果不想输入这个密码,两种方法,一种是你生成key的时候不输入 passphrase,二是使用 ssh-agent

表情:<( ̄︶ ̄)> | (⊙ˍ⊙) | >﹏< | b( ̄▽ ̄)d | (─.─||) | (^_-)

[ Ctrl+Enter提交 ]

Powered by WP Hashcash

Additional comments powered by BackType