Conversion of Linux SSH key

Source: Internet
Author: User

When we use a Linux host, we typically produce two forms of key, one that is generated on a Linux host and then distributed with the private key, and one that is generated with the SSH tool and then uploads the public key to the server. The following three scenarios require a key conversion.

Original blog from: www.51niux.com bo: Busy Firewood less

1. The first type, using putty to generate the. PPK private key, but we are the CRT or X-shell and other SSH tools, now need to convert the private key. For example, I now putty the generated private key name is TEST.PPK, then how to convert to ID_RSA format, the operation is as follows:

First, the first step is to download the installation tool:

wget http://the.earth.li/~sgtatham/putty/latest/putty-0.63.tar.gz
Tar zxvf putty-0.63.tar.gz && CD putty-0.63
./configure
Make

Make install

Puttygen Test.ppk-o Private-openssh-o/root/id_rsa

If you want to convert to PEM format, execute the following command:
Puttygen Test.ppk-o Private-openssh-o/root/test.pem

Ps:
Compile and install Puttygen, this is the tool of conversion.
Specify the format to convert to After-O, which must be written as Private-openssh
-O is used to specify the path and name of the converted private key.

2. The second type of key pair, such as CRT or X-shell, requires the conversion of ID_RSA into. PPK format.

This method of operation online a lot of wine directly affixed to the link address:

Http://blog.slogra.com/post-245.html (Note 1)

What if you want to convert the PEM to. ppk format? See the link below

Linux/zhengshugeshizhuanhuan__pemzhuanchengppk_24538_1353077234.html (Note 2)

3. Third, we use Windows generated key pair, public key non-. Pub format, need to convert, here is the command:

Ssh-keygen-if Test >>test.pub

In order to prevent the link from invalidating, I want the link content to be copied to prevent loss:

Note 1:

We all know that the SSH private key generated under Linux only Tera term this software can be used, but Tera term cannot upload files, can only use WINSCP to upload, but WINSCP use the private key format is PPK, so the private key under Linux to convert to PPK format.

Required Software: Puttygen.exe

1. Download Puttygen

Everyone can go to http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html this address separately download Puttygen

2. Convert to PPK format

Run puttygen.exe-Click on the import key in the Conversions menu item and select the Id_rsa file generated under Linux as the following figure

650) this.width=650; "Src=" http://blog.slogra.com/content/plugins/kl_album/upload/201208/ 2010c394aaf9bfe594bebe9be2e74bff20120828135443645321285.jpg "alt=" Click to view Original "width=" 483 "height=" 464 "border=" 0 "style = "Height:auto;vertical-align:middle;"/>

Then click on the Save Provate key button to convert to PPK format.

650) this.width=650; "Src=" http://blog.slogra.com/content/plugins/kl_album/upload/201208/ 117df1e0ee1bc0d50bcd0999660ea02b201208281354441634277658.jpg "alt=" Click to view Original "width=" 480 "height=" 243 "border=" 0 " Style= "Height:auto;vertical-align:middle;"/>

650) this.width=650; "Src=" http://blog.slogra.com/content/plugins/kl_album/upload/201208/ C8e8b891489d204632415ff5385d5bd1201208281354442074591326.jpg "alt=" Click to view the original "width=" 555 "height=" "" border= "0" style = "Height:auto;vertical-align:middle;"/>

Well, you can see that the original RSA format of the private key has been converted to PPK, you can import and use in the WINSCP.
650) this.width=650; "Src=" http://blog.slogra.com/content/plugins/kl_album/upload/201208/ 4abba027f6621d09b90824a88555dd23201208281354411825025545.jpg "alt=" Click to view Original "width=" 94 "height=" 146 "border=" 0 "style = "Height:auto;vertical-align:middle;"/>
All right, here we go.


NOTE 2:

Certificates in PEM format can be used directly in Linux/mac: for example, Telnet to a Linux host: ssh-i XX.PEM [email protected]

However, in Windows it is not very convenient, the following is to convert PEM format to PPK format, and then use Putty login.

1. Download Puttygen.exe:

Http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

2. Double-click Start Puttygen.exe

3. Click Load, then select the PEM-formatted certificate, then click Open

4. When prompted to import successfully, click OK

5. Click Save private key to confirm that you do not enter a password to protect private key, click OK, then save a name to PPK format,

6. Close Puttygen

Login:

1. Start putty, private key for authentication in SSH, connection, auth to select the PPK format certificate

Original blog from: www.51niux.com bo: Busy Firewood less


This article from "Technology in the progress of sharing" blog, declined reprint!

Conversion of Linux SSH key

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.