1. Use Putty To Generate Ssh Key Windows
  2. Use Putty To Generate Ssh Keys
  3. Using Putty To Generate Ssh Key
  4. Putty Setup Ssh Key
  5. Use Putty To Generate Ssh Key
  6. Putty Use Ssh Key

PuTTYgen is an key generator tool for creating SSH keys for PuTTY. It is analogous to the 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. To generate a key with PuTTY, you should: Download and start the puttygen.exe generator. In the 'Parameters' section choose SSH2 DSA and press Generate. Move your mouse randomly in the small screen in order to generate the key pairs. Enter a key comment, which will identify the key (useful when you use several SSH keys).

Related

How To Find Broken Links on Your Website Using Wget on Debian 7 Tutorial
How To Set Up SETI@home on Ubuntu 14.04 or Debian 7 Tutorial

Introduction

You have seen in previous tutorials how to use PuTTY to connect to your VPS securely and how to create SSH keys with PuTTYgen.

You might have more than one SSH key for a single cloud server, or simply more than one cloud server or Droplet that requires SSH keys to log into. This can make you feel overwhelmed with having to manage, sort out, and link all those keys to their respective servers. That’s why Pageant exists.

Pageant is a PuTTY authentication agent. It holds your private keys in memory so that you can use them whenever you are connecting to a server. It eliminates the need to:

  • Explicitly specify the relevant key to each Linux user account, if you use more than one account to log into a server
  • Type a key’s passphrase each time you log into your user account; and your keys should be passphrase protected since having an unprotected key is as good as hiding your password under your keyboard!

Prerequisites

Make sure you have these prerequisites.

  • Pageant is installed together with the PuTTY suite; if you don’t have it installed, you can download it here
  • You should already have at least one SSH key saved on your local computer

Step 1 — Adding Keys to Pageant

Start Pageant from the PuTTY folder: Start-Menu > All Programs > PuTTY > Pageant

Pageant starts by default minimized in the system tray. To begin adding your SSH keys, you should right click on its icon and then the following context menu will show up:

Clicking on Add Key from the menu or View Keys to open up the Pageant Key List window. Here you can view, add, and remove keys:

Tip: You can access the Pageant Key List window directly by double-clicking its icon in the system tray.

Click the Add Key button. This will open the file explorer, where you can choose one or more keys at a time to load. You should select files with the .ppk extension:

Click the Open button to load the keys with Pageant.

If a key is passphrase-protected, you will be prompted to enter the passphrase only once before it can be added to the Pageant Key List:

After successfully adding a key, you can now see it listed:

Step 2 — Connecting to the Server(s)

Now these keys will be available while connecting to any server during your PuTTY sessions. You don’t have to take any extra steps in PuTTY. Just enter your hostname or IP address, and SSH user. PuTTY will automatically try to authenticate using any keys currently loaded in Pageant.

Step 3 (Optional) — Removing Keys from Pageant

If you want to remove a key from Pageant, select that key from the Pageant Key List window and press the Remove Key button. You can also remove multiple keys together by selecting them with CTRL or SHIFT.

Tips & Tricks

Use these tips to automate your authenticated connections with Pageant.

Loading Keys Automatically on Pageant Startup

You can make Pageant automatically load one or more private keys when it starts up, instead of adding them manually every time you start up Pageant.

Go to the Pageant shortcut icon from the Windows Start Menu or your desktop.

Right click on the icon, and click on Properties.

A new window will open containing the shortcut’s properties:

From the Shortcut tab, edit the Target field. Leave the path to pageant.exe intact. After that path, add paths to your .ppk key files. These should be outside the quotation marks. Here’s an example:

Click the Apply and then OK buttons.

Note: If the keys are encrypted, Pageant will request the passphrases on startup.

Making Pageant Run PuTTY

You can make Pageant start PuTTY or any other program once it has initialized itself and loaded any keys specified on its command line. That way you can just start Pageant instead of having to start both programs.

You can achieve this by following the same steps we used previously to add the keys automatically (see the previous section). Just add the program’s path at the end of the command in the Target field, preceded by the -c option, and contained within double quotes. Here’s an example of the full line for the Target field:

Other PuTTY Suite Products

Here are a few other helpful applications that can work with PuTTY.

  • PuTTYgen: A tool to generate and edit SSH public and private key pairs. It is part of the PuTTY suite, but it can also operate with the private key formats used by some other SSH clients like WinSCP
  • PSFTP: An interactive text-based client for the SSH-based SFTP (secure file transfer) protocol, that allows you to run an interactive file transfer session and perform many thing like listing the contents of directories, browsing around the file system, issuing multiple get and put commands, etc.
  • PSCP (PuTTY Secure Copy Client): A tool for transferring files securely between computers using an SSH connection

PuTTYgen is a key generator tool for creating pairs of public and private SSH keys. It is one of the components of the open-source networking client PuTTY. Although originally written for Microsoft Windows operating system, it is now officially available for multiple operating systems including macOS, Linux. PuTTYgen.exe is the graphical tool on Windows OS. While on the other side, Linux OS has the only command-line version could be accessible using SSH commands.

  • 1 Download PuTTYgen
    • 1.1 Download PuTTYgen on Windows
    • 1.2 Download PuTTYgen for Mac
    • 1.3 Download PuTTYgen for Ubuntu/Linux
      • 1.3.3 Types of Keys Supported on PuTTYgen

Puttygen aka Putty Key Generator

The key generation utility – PuTTYgen can create various public-key cryptosystems including Rivest–Shamir–Adleman (RSA), Digital Signature Algorithm (DSA), Elliptic Curve Digital Signature Algorithm (ECDSA), and Edwards-curve Digital Signature Algorithm (EdDSA) keys.

The aforementioned public-key cryptosystems principally focus on secure data transmission and digital signatures.

Although PuTTYgen collects keys in its native file format i.e. .ppk files, the keys can easily be converted to any file format. For Windows, the software interface is PuTTYgen.exe, whereas, for Linux OS the command-line adaptation is available using SSH commands.

How to use PuTTYgen?

PuTTYgen is used to generate public or private key pair for creating SSH keys. Below is the complete guidance about how to generate RSA key in the Windows operating system:

  1. Once you install the PuTTY on your machine, you can easily run PuTTYgen. For the same, go to Windows -> Start Menu -> All Programs -> PuTTY -> PuTTYgen.
  2. You will see the PuTTY key generator dialog box on your screen
  3. You will find a “Generate” button in that dialog. Clicking on it will lead to generating the keys for you.
  4. Now you will need to add a unique key passphrase in the Key passphrase and Confirm passphrase field.
  5. Click on the “Save Public Key” and “Save Private Key” buttons to save your public and private keys.
  6. You will see the text starting with ssh-RSA in the Public key for pasting into OpenSSH authorized_keys file field which is located at the top of the window. Copy that entire text to your clipboard by pressing ctrl+c as you will require the key to paste on your clipboard in the public key tool of control panel or directly on the cloud server.

Various Ways to Use RSA Key Pair

RSA key pair generated through PuTTYgen is used in two various ways defined as below:

  1. To assign while creating a new cloud server
    You can choose the public key from the given list of keys at the time of creating a cloud server. If you don’t find your key in that list, then first add and then assign it.
  2. Assign to an existing cloud server
    At the time of connecting to the cloud server, first of all, you need to tell PuTTY to use it for utilizing your newly created RSA key pair.

PuTTYgen being a component of the terminal emulator PuTTY does not have to be downloaded separately, hence, comes with the PuTTY .msi installation package. You can follow the simple steps to download PuTTYgen software for your system. That is the reason why you don’t need to download PuTTYgen separately. Once you download PuTTY software, you will be able to install and run PuTTYgen easily in no time. Below is the complete instruction about how to download and install PuTTY on Windows.

Apart from that, it is also integrated into third-party programs such as WinSCP installation package. Below you can find a complete PuTTYgen download and installation guide for all operating systems.

Download PuTTYgen on Windows

To download PuTTYgen the primary requisite is to acquire the copy of PuTTY installation package. For the 64-bit operating system, one must install the 64-bit version of PuTTY, i.e. putty-64bit-<version>-installer.msi.Similarly, for the 32-bit operating system, the respective 32-bit version of PuTTY, i.e. putty-<version>-installer.msi needs to be installed.

To get PuTTY, go to PuTTY Installation Download page, whereby the complete installation package will be available with setup instructions, installation guide, and download links to all other components of PuTTY such as putty.exe, pscp.exe, psftp.exe, puttytel.exe, plink.exe, pageant.exe and putty.zip.


Following the successful download of the PuTTY installation package. It is time to install the program. Go to How to install PuTTY on Windows, whereby you will find the step by step guidance for PuTTY installation for Windows operating system.

After successfully downloading and installing PuTTY on your Windows machine, you are just 2-3 clicks away to run PuTTYgen. Follow the below-given step by step guidance to run PuTTYgen:

Run PuTTYgen on Windows

Generate

To run PuTTYgen, Go to Windows -> Start Menu -> All Programs -> PuTTY -> PuTTYgen. You will see a window for the PuTTY Key Generator on your screen.

Voila! Now you can generate public or private key pair using PuTTYgen.

Download PuTTYgen for Mac

Putty setup ssh key


Below is the detailed guide to download PuTTYgen on Mac operating system. Mac OS has a built-in command-line SSH client known as Terminal. To utilize it, go to Finder and then opt for Go -> utilities from the top menu. After that find the terminal which supports SSH connections to remote servers.

Use Putty To Generate Ssh Key Windows

However, to run PuTTYgen for mac, the first one must have to install PuTTY. There are multiple ways to install PuTTY, which are Homebrew or MacPorts. Both alternatives will also install the command-line of adaptations of PuTTYgen.

Ported PuTTY for Mac

Mac has the port of PuTTY which can be installed in various ways described as below:

  1. Installation using Homebrew:
    First, install the ‘brew command line’ Once installed use the below-given command to install PuTTY:-
    sudo brew install putty
  2. Installation using MacPorts:
    First of all, one must install MacPorts and then use the command-line to install PuTTY. Here is the command to install PuTTY via MacPorts
    sudo port install putty
    Additionally, a user can also add a shortcut to the desktop by writing the following command line
    –cp /opt/local/bin/putty ~/Desktop/PuTTY

However, there is an alternative way to install PuTTY on Mac OS. Cyberduck is a widely used Mac OS SSH Client. Once PuTTY installed on the Mac OS, a user can convert PuTTY derived private key format to OpenSSH.

To convert the private key to standard PEM format, type the following command –

Use

puttygen privatekey.ppk -O private-openssh -o privatekey.pem

You can also read the guide to convert .pem file to .ppk using puttygen.

Use Putty To Generate Ssh Keys

Download PuTTYgen for Ubuntu/Linux

To download PuTTYgen for Ubuntu (Linux) operating system, a user to first install PuTTY. However, in some Linux distributions, the SSH key generation tool – PuTTYgen needs to be installed independently from the PuTTY client.

For example, Debian Linux requires the below-given code to install PuTTYgen:

sudo apt install putty-tools

Generate Key Pair for Authentication in Linux

To create the key pair for authentication in Linux use the below command:-

puttygen -t rsa -b 2048 -C 'user@host' -o keyfile.ppk

Various Command Line Options of PuTTY in Linux

Using Putty To Generate Ssh Key

Below are few important command line options in the Linux operating system for PuTTY:

Putty Setup Ssh Key

PuTTYgen [-t keytype [-b bits] [-q] | keyfile]
[-C new-comment] [-P]
[-O output-type | -p | -l | -L]
[-o output-file]

Options:

  1. Keyfile – It is the name of the existing key file to read at the time of changing the current key.
  2. t keytype – The command specifies the type of key to creating. Its acceptable values are RSA and dsa.rsa1.
  3. -b bits – This command specifies a total number of bit in a particular key. 1024 is the perfect size for DSA key, while 2048 or 4096 are the perfect size for RSA keys.
  4. q – The command suppresses the message about progress at the time of key generation.
  5. -C new-comment – The command will specify the comment to describe the key. It can be used for the new and/or existing key. Key operation is not affected by a comment. However, it is used to recognize the key owner, it’s not reliable completely as any value can be applied to it.
  6. –P – Using the command will update the passphrase of a key. Passphrase helps to encrypt the private key. As passphrase can’t add or update on a command line, it prompts a new passphrase tool to alter it.
  7. –old-passphrase-file – The old password of the key remains in this file. The command is used when the key is protected by a passphrase.
  8. –new-passphrase file – This command prompts the new passphrase of the key. It comes in the action either at the time of generating a new key or while applying –P command to change the passphrase.
  9. -O output-type – This command defines what to give in output. By default, the private key is the output.

Thus, above are the prominent commands of PuTTYgen in Linux operating system. Besides that, there are many other commands available to perform various tasks from the command prompt in Linux at flank speed.

Use Putty To Generate Ssh Key

Types of Keys Supported on PuTTYgen

Putty Use Ssh Key

It is important to know the types of key PuTTYgen supports prior to using it. Below are the key types that it currently supports for SSH-2 and SSH-1 protocol:-

  • SSH-1 protocol:- For SSH-1 only supports one key i.e. Rivest–Shamir–Adleman (RSA)
  • SSH-2 protocol: – SSH-2 supports multiple key types that include – Digital Signature Algorithm (DSA), Elliptic Curve Digital Signature Algorithm (ECDSA) and Ed25519.

The above description is a detailed brief on downloading and running PuTTYgen on all major operating systems. For further details please check the Download PuTTY page.