---
title: How to install and use Puttygen to create new key pairs
description: How to install and use puttygen to create new key pairs and change passphrases.  Installing keys on server, managing SSH keys.
---

[Academy ](https://www.ssh.com/academy)

# [How to install and use Puttygen to create new key pairs](https://www.ssh.com/academy/ssh/putty/windows/puttygen)

 Written by [Admin](https://www.ssh.com/academy/author/admin) | Sep 24, 2019 4:00:00 AM

This page is about PuTTYgen on Windows. For the Linux version, see [here](https://www.ssh.com/ssh/putty/linux/puttygen).

PuTTYgen is an key generator tool for creating [SSH keys](https://www.ssh.com/academy/ssh-keys) for [PuTTY](https://www.ssh.com/ssh/putty/download). It is analogous to the [ssh-keygen](https://www.ssh.com/academy/ssh/keygen) tool used in some other SSH implementations.

The basic function is to create public and private key pairs. PuTTY stores keys in its own format in `.ppk` files. However, the tool can also convert keys to and from other formats.

`PuTTYgen.exe` on Windows is a graphical tool. A [command-line version](https://www.ssh.com/academy/ssh/putty/linux/puttygen) is available for Linux.

### Contents

[PuTTYgen download and install](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#puttygen-download-and-install) [Running PuTTYgen](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#running-puttygen) [Creating a new key pair for authentication](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#creating-a-new-key-pair-for-authentication) [Installing the public key as an authorized key on a server](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#installing-the-public-key-as-an-authorized-key-on-a-server) [Managing SSH keys](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#managing-ssh-keys) [Changing the passphase of a key](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#changing-the-passphase-of-a-key) [Videos illustrating use of PuTTYgen](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#videos-illustrating-use-of-puttygen) [Using PuTTYgen to generate an SSH key](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#using-puttygen-to-generate-an-ssh-key) [How to set up PuTTY SSH keys for passwordless logins using Pagent](https://www.ssh.com/academy/ssh/putty/windows/puttygen?hs_amp=true#how-to-set-up-putty-ssh-keys-for-passwordless-logins-using-pagent)

## PuTTYgen download and install

PuTTYgen is normally installed as part of the normal PuTTY `.msi` package installation. There is no need for a separate PuTTYgen download. [Download the PuTTY installation package](https://www.ssh.com/academy/ssh/putty/download). For detailed installation instructions, see [PuTTY installation instructions](https://www.ssh.com/academy/ssh/putty/windows/install).

## Running PuTTYgen

Go to Windows **Start menu** → **All Programs** → **PuTTY** → **PuTTYgen**.

## Creating a new key pair for authentication

To create a new key pair, select the type of key to generate from the bottom of the screen (using `SSH-2 RSA` with 2048 bit key size is good for most people; another good well-known alternative is `ECDSA`).

Then click **Generate**, and start moving the mouse within the Window. Putty uses mouse movements to collect randomness. The exact way you are going to move your mouse cannot be predicted by an external attacker. You may need to move the mouse for some time, depending on the size of your key. As you move it, the green progress bar should advance.

Once the progress bar becomes full, the actual key generation computation takes place. This may take from several seconds to several minutes. When complete, the public key should appear in the Window. You can now specify a[ passphrase](https://www.ssh.com/academy/ssh/passphrase) for the key.

You should save at least the private key by clicking **Save private key**. It may be advisable to also save the public key, though it can be later regenerated by loading the private key (by clicking **Load**).

We strongly recommended using a passphrase be for private key files intended for interactive use. If keys are needed for automation (e.g., with [WinSCP](https://www.ssh.com/academy/ssh/winscp), then they may be left without a passphrase.

## Installing the public key as an authorized key on a server

With both [Tectia SSH](https://www.ssh.com/products/tectia-ssh/) and[ OpenSSH](https://www.ssh.com/academy/ssh/openssh) servers, access to an account is granted by adding the public key to a [~/.ssh/authorized_keys](https://www.ssh.com/academy/ssh/authorized-keys-file) file on the server.

To install the public key, Log into the server, edit the `authorized_keys` file with your favorite editor, and cut-and-paste the public key output by the above command to the `authorized_keys` file. Save the file. Configure PuTTY to use your private key file (here `keyfile.ppk`). Then test if login works. See [configuring public key authentication for PuTTY](https://www.ssh.com/academy/ssh/putty/public-key-authentication).

## Managing SSH keys

In larger organizations, the number of SSH keys on servers and clients can easily grow to tens of thousands, in some cases to millions of keys. In large quantities, SSH keys can become a massive security risk and they can violate compliance requirements.

[Universal SSH Key Manager](https://www.ssh.com/products/universal-ssh-key-manager/) can manage PuTTY keys in addition to OpenSSH and Tectia keys. It works with legacy keys on traditional servers as well as dynamic and keyless elastic environments in the cloud. Any larger organization should ensure they have proper provisioning and termination processes for SSH keys as part of their Identify and Access Management (IAM) practice.

## Changing the passphase of a key

It is recommended that all SSH keys be regenerated and changed periodically. The Universal SSH Key Manager can automate this. Just changing the passphrase is no substitute, but it is better than nothing. These instructions can also be used to add a passphrase to a key that was created without one.

To change the passphrase, click on **Load** to load an existing key, then enter a new passphrase, and click **Save private key** to save the private key with the new passphrase. Be sure to properly destroy and wipe the old key file. Creating a new file with a new passphrase will not help if the old file remains available.

## Videos illustrating use of PuTTYgen

### Using PuTTYgen to generate an SSH key

[Using PuTTYgen to generate an SSH key](https://www.youtube.com/watch?v=-92wEg68SKQ)

### How to set up PuTTY SSH keys for passwordless logins using Pagent

[How to setup PuTTY SSH keys for passwordsless logins using Pagent](https://www.youtube.com/watch?v=2nkAQ9M6ZF8)

[View full post](https://www.ssh.com/academy/ssh/putty/windows/puttygen)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Admin"
  },
  "dateModified" : "2025-04-29T13:39:09.852Z",
  "datePublished" : "2019-09-24T04:00:00Z",
  "headline" : "Using PuTTYgen on Windows to generate SSH key pairs",
  "image" : {
    "@type" : "ImageObject",
    "height" : 60,
    "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
    "width" : 60
  },
  "mainEntityOfPage" : "https://www.ssh.com/academy/ssh/putty/windows/puttygen",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Academy"
  }
}
```