Generate SSH key pair puttygen

Mac terminal This article explains how to create an SSH key pair for logging in to JASMIN. It covers:

  • The shell terminal
  • Using ssh-keygen to create an SSH key pair
  • Converting a PuTTYGen private key for use with MobaXterm (Windows only)

The shell terminal

Generating an SSH key pair requires an SSH client and a Shell terminal. Linux and Mac users can use a standard terminal which is very likely to have SSH installed. Windows users are advised to install the MobaXterm application which provides a linux-style terminal with all the relevant utilities included. Figures 1 and 2 show example terminal windows on a Mac and Windows (using MobaXterm).

Figure 1. Screenshot of a shell terminal on a Mac.

Figure 2. Screenshot of a shell terminal using the MobaXterm client on Windows.

Using ssh-keygen to create an SSH key pair

The ssh-keygen command should be used in order to generate your SSH key pair. Open a terminal and generate your public and private key, as follows (replace the e-mail address with your own):

At the prompt, type a secure passphrase to protect your SSH private key. This is a requirement for access to JASMIN machines. The output will look something like this:

Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/users/meuser/.ssh/id_rsa_jasmin. Your public key has been saved in /home/users/meuser/.ssh/id_rsa_jasmin.pub. The key fingerprint is: Running ssh-keygen will generate two files in your $HOME/.ssh/ directory:

  • id_rsa_jasmin - the private key file (which should have permission "400", i.e. readable only by you)
  • id_rsa_jasmin.pub - the public key file

The public key file is the part that you need to share in order to access JASMIN. The private key file should be protected and not shared with others.

Generate SSH key windows puttygen

Vagrant putty puttygen

Generate SSH public key puttygen

Generate public private key puttygen

Generate public private key pair puttygen