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

(Continued from page 1)

Now, I open PuTTY. My server is located at I enter the IP address and give the 'Session' a name (the same IP address). This data can be saved by clicking Save.


I go to Connection → SSH → Auth. In the "Private key file for authentication", I locate my private key.

putty auth

I go to Connection → Data and enter my Unix login name in the "Auto-login username" box.

Putty Auto-login username

I go back to Session and click Save to save the session data.

putty save session

Now, time to connect! Click the Open button.

putty open connection

Putty opens an SSH window to the server with the user name "deron" using public key authentication. We need to enter key passphrase that we created in puttygen. After entering the passphrase, we're logged into the server!

logging into server via public key authentication

If you don't want to have to type your passphrase each time you log in, you can use Pageant (which comes with PuTTY). If you start Pageant, you can right-click on its icon and go to Add Key.

Add Key in Pageant

Select your private key.

Selecting private key with pageant

Then, enter your passphrase.

Entering passphrase with pageant

Now, Pageant is all set up. If Pageant is running and we now try to connect to the server, we no longer need to manually enter our passphrase.

Logging in automatically with pageant

That's it. In this tutorial, we've seen how we can use Puttygen to generate a public/private key pair safeguarded with a passphrase, we've seen how we can use these keys to connect to an SSH server using PuTTY, and we've seen how we can automate the passphrase process using Pageant.

Page: < 1 2