PuTTY with SSH key tutorial

From Nasqueron Agora

This tutorial shows how to generate a new SSH key, then configure a PuTTY session to use it.

What's this?

To login to the server, instead of a password, you use a key.

This key is divided in two parts:

  • the public key, you give freely (you can publish it on your webpage for example) where you need to have an access
  • the private key, you keep very safely and privately for you and only you

The public key is more like a login, the privave key more like a password.

Generate a new SSH key

PuTTY ships a software to generate a key, PuTTYGen. You can download it on http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

Step 1. Run it, and you've this screen. Click on the generate button.

Step 2. Move the mouse to generate some randomness. That will be used to generate a random key, a key we can't guess.

Step 3. Copy/paste the content of first textarea (ssh-rsa ...): this is your public key.

Save safely where you want the key ("Save private key").

If you set a password, the key will be encrypted, and a password asked each time you use the key.

Configure a PuTTY session to log in with a SSH key