How do I use public key authentication over SSH from a Windows client?
Author: Deron Eriksson
Description: This tutorial demonstrates how to use puttygen, putty, and pageant to perform public key authentication using SSH.
Tutorial created using: Fedora 12


Page:    1 2 >

PuTTY, which can be downloaded at http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html, is a nice SSH client that is available for Windows. In this tutorial, we'll use PuTTY and a couple of its accompanying programs to perform public key authentication over SSH to a Fedora server.

Let's get started. First off, we need to generate a public key/private key pair. If you're unfamiliar with public key cryptography, the public key is a key that identifies you that you can publish to the outside world. The private key, on the other hand, is a key that you keep secret. If you have the private key, you can be identified as you, since that particular public key requires being matched to that particular private key for authentication.

PuTTY comes with an application called puttygen (PuTTY Key Generator) that can be used to generate the public/private key pair. So, open puttygen and click the Generate button to begin the process. We'll go with the default parameters.

puttygen

After clicking the Generate button, you need to move the mouse to generate some random data.

generating random data in puttygen

When done with this, the public and private keys will be generated. I added a key comment (my name) and a key passphrase. This passphrase will be required for authentication.

At this stage, I'll copy the 'public key for pasting'. This can be seen by the highlighted text below.

public/private keys generated, and copying public key for pasting

Now, on the server, in my user home directory's .ssh directory (ie, /home/deron/.ssh), I create an authorized_keys file. I paste the copied public key into the file and saved it, and then change the file permissions to 600 via "chmod 600 authorized_keys".

created authorized_keys file with public key

Back in puttgen, I save the public key to my putty directory.

saving public key public key saved to putty directory

I also save my private key to the same directory.

private key saved to putty directory putty directory

(Continued on page 2)

Page:    1 2 >