PuTTY with SSH key tutorial: Difference between revisions

From Nasqueron Agora
No edit summary
No edit summary
Line 1: Line 1:
This tutorial shows how to generate a new SSH key, then configure a PuTTY session to use it.
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 ==
== 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.
[[File:PuTTY_Key_Generator_2.png]]
[[File:PuTTY_Key_Generator_2.png]]
'''Step 2.''' Move the mouse to generate some randomness. That will be used to generate a random key, a key we can't guess.


[[File:PuTTY_Key_Generator.png]]
[[File:PuTTY_Key_Generator.png]]
'''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.


[[File:PuTTY_Key_Generator_3.png]]
[[File:PuTTY_Key_Generator_3.png]]

Revision as of 18:17, 8 October 2016

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