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:
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).
![](http://www.cnx-software.com/wp-content/uploads/2012/07/putty_openssh_key_import.png)
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.
![](http://www.cnx-software.com/wp-content/uploads/2012/07/putty_ssh_private_key_login.png)
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.
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) |
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).
![](http://www.cnx-software.com/wp-content/uploads/2012/07/putty_openssh_key_import.png)
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.
![](http://www.cnx-software.com/wp-content/uploads/2012/07/putty_ssh_private_key_login.png)
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.
相关文章推荐
- How to generate an SSH key on Windows using PuTTY?
- How to use WinSCP with public key authentication
- How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET(利用Ado.net导出到Excel)
- How to use an Outlook Object Model from Visual C++ by using a #import statement
- how to sign an assembly with a strong name & how to create a pair key怎样通过强名给程序集签名以及如何创建钥匙对?
- How to sort an array of hashes into hashes with multiple values for a key?
- How to Setup and Secure Linux SSH Logins to use Private PEM Keys
- How to Setup and Secure Linux SSH Logins to use Private PEM Keys
- [转]how to sign an assembly with a strong name & how to create a pair key怎样通过强名给程序集签名以及如何创建钥匙对?
- [转贴]How to work with stored procedures by using script in an Office InfoPath 2003 form
- How to Use RSA Key for SSH Authentication
- How to use an ASP.NET application to query an Indexing Service catalog by using Visual Basic .NET
- How to generate ssh key only for github and not conflict with original key
- how to use a SQLite database in a standalone program with an HTML interface and VBScript as the programming language
- 1.How to Generate an SSH Key
- An error "Host key verification failed" when you connect to other computer by OSX SSH
- How to combine the value of multiple hashes within an array by the same key
- How To Create an ASP.NET HTTP Handler by Using Visual C# .NET
- HOWTO: How to tunnel with SSH - Part 1
- How to Make an AiO [Reloaded Edition] by vertigo173