您的位置:首页 > 运维架构

How To Use Putty with an SSH Private Key Generated by OpenSSH

2017-01-04 10:00 483 查看
I have access to a remote server where I am only allowed to login via SSH with a key, and I can’t add an extra key by myself, as described in “No
Password SSH” post. The private key (RSA) has been generated with ssh-keygen in Linux, and I can login from Linux without issue.

This morning, I wanted to do the same with Putty in Windows XP, so I just copied the private key to Windows and loaded it in Putty, but it failed:

1

Unable
to
use
key
file
"F:\Downloads\cnxsoft\a1000\id_rsa"
(OpenSSH
SSH-2
private
key)

After a few minutes of research, I found my answer on UbuntuForums, and the reason it fails is because Putty does
not support openssh keys, but uses its own format.

[align=center][/align]

Here’s what I had to do:
Convert OpenSSH private key to Putty private key with Putty Key Generator (puttygen)

Start puttygen, and click on Conversions->Import key, then click Browse and select the private key generated with openssh (e.g. id_rsa).


Then
click on Save private key (e.g. id_rsa_putty.ppk)
Putty SSH login with private key.

Now you can start Putty, enter the machine IP address or url as usual, then go to Connection->SSH->Auth.


Click Browse,
and select your private key file (e.g. id_rsa_putty.ppk), go back to Session and save the session. You should now be able to login to the server.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐