Puttygen Generate Private Key From Pub File
You can convert a base64/pem key, used by OpenSSL, or OpenSSH, to the Putty PPK format. The conversion requires OpenSSL, OpenSSH, and Putty.
May 05, 2019 Open a text editor, paste the characters and save it. Be sure you are pasting the entire key. It is advisable to save the file in the same directory where you saved the private key, using the same name the private key and.txt or.pub as a file extension. This is the key that you will add it to your Linux server.
Setp 1: Deciphering the key (if pertinent)
Alternatively if you want to grab the private and public keys from a PuTTY formated key file you can use puttygen on.nix systems. For most apt-based systems puttygen is part of the putty-tools package. Outputting a private key from a PuTTY formated keyfile: $ puttygen keyfile.pem -O private-openssh -o avdev.pvk. For the public key. Click 'Generate'. Next, move your mouse around the blank area to create 'randomness' in the key generation. When done, puttygen displays key information, including the public key string to be put in the.pub file on the target, a fingerprint, and a comment. If you need to see the public key in the right format after the private key has been saved: Open PuTTYgen. Next to Load an existing private key file, click the Load button. Navigate to the private key in your file system and select it. Add your public key to your DigitalOcean account to be able to embed it in new Droplets on creation. This tutorial shows you how to change your private key format, to use with PuTTY, which is a Secure Shell (SSH) client for Windows that can connect to a remote machine. If you're using SSH on Linux, then this tutorial isn't for you. If you don't have these, then create a cloud service instance. How do I install an SSH private key generated by PuTTYgen? Ask Question. Mykey-pub.ppk is pretty confusing, as.ppk file has a completely different format and is used for key pairs. Load the public / private key pair you generated in puttygen again. In puttygen, you'll notice a window in the middle of the screen which says: 'Public key.
If your private key is encrypted, e.g. if you used Keybot, you will first need to decipher it:
Puttygen Download
You will be prompted for the password. In case of error, a message will describe an password or decryption issue.
Setp 2: Securing the key file
To prevent security risks, apply appropriate permissions on the key file. Without that, ssh-keygen will refuse to work on the file.
Step 3: Pre-converting the key without defining a password
You will need to pre-convert the key to be ready to be converted by Puttygen. When a password prompt appears, you will need to leave it empty, by pressing the enter key twice.

Step 4: Convert the key to PPK
You then need to convert the key to PPK:
If you use the unix cli binary:
You can also generate a public key for your SSH servers, using one of the two following commands, depending on your server:
If you use the Windows binary, you will need to use the graphical tool Puttygen:
- Open Puttygen, then go to the menu Conversions - Import key
- Select your private key file
- Your key has now been imported in Puttygen.
- In theActions section, click on Save private key.
- Choose the name and path to your new PPK file and save it.
- Then click on Save public key.
- Choose your public key file name and path, and save it.
See also

Several tools exist to generate SSH public/private key pairs. The following sections show how to generate an SSH key pair on UNIX, UNIX-like and Windows platforms.
Generating an SSH Key Pair on UNIX and UNIX-Like Platforms Using the ssh-keygen Utility
UNIX and UNIX-like platforms (including Solaris and Linux) include the ssh-keygen utility to generate SSH key pairs.
- Navigate to your home directory:
- Run the ssh-keygen utility, providing as
filename
your choice of file name for the private key:The ssh-keygen utility prompts you for a passphrase for the private key.
- Enter a passphrase for the private key, or press Enter to create a private key without a passphrase:
Note:
While a passphrase is not required, you should specify one as a security measure to protect the private key from unauthorized use. When you specify a passphrase, a user must enter the passphrase every time the private key is used.
The ssh-keygen utility prompts you to enter the passphrase again.
- Enter the passphrase again, or press Enter again to continue creating a private key without a passphrase:
- The ssh-keygen utility displays a message indicating that the private key has been saved as
filename
and the public key has been saved asfilename
.pub
. It also displays information about the key fingerprint and randomart image.
Generating an SSH Key Pair on Windows Using the PuTTYgen Program
Advantages Of Private Key Encryption
The PuTTYgen program is part of PuTTY, an open source networking client for the Windows platform.
Private Key Bitcoin
- Download and install PuTTY or PuTTYgen.
To download PuTTY or PuTTYgen, go to http://www.putty.org/ and click the You can download PuTTY here link.
- Run the PuTTYgen program.
- Set the Type of key to generate option to SSH-2 RSA.
- In the Number of bits in a generated key box, enter 2048.
- Click Generate to generate a public/private key pair.
As the key is being generated, move the mouse around the blank area as directed.
- (Optional) Enter a passphrase for the private key in the Key passphrase box and reenter it in the Confirm passphrase box.
Note:
While a passphrase is not required, you should specify one as a security measure to protect the private key from unauthorized use. When you specify a passphrase, a user must enter the passphrase every time the private key is used.
- Click Save private key to save the private key to a file. To adhere to file-naming conventions, you should give the private key file an extension of
.ppk
(PuTTY private key).Note:
The.ppk
file extension indicates that the private key is in PuTTY's proprietary format. You must use a key of this format when using PuTTY as your SSH client. It cannot be used with other SSH client tools. Refer to the PuTTY documentation to convert a private key in this format to a different format. - Select all of the characters in the Public key for pasting into OpenSSH authorized_keys file box.
Make sure you select all the characters, not just the ones you can see in the narrow window. If a scroll bar is next to the characters, you aren't seeing all the characters.
- Right-click somewhere in the selected text and select Copy from the menu.
- Open a text editor and paste the characters, just as you copied them. Start at the first character in the text editor, and do not insert any line breaks.
- Save the text file in the same folder where you saved the private key, using the
.pub
extension to indicate that the file contains a public key. - If you or others are going to use an SSH client that requires the OpenSSH format for private keys (such as the
ssh
utility on Linux), export the private key:- On the Conversions menu, choose Export OpenSSH key.
- Save the private key in OpenSSH format in the same folder where you saved the private key in
.ppk
format, using an extension such as.openssh
to indicate the file's content.