Using Public Key Authentication with PUTTY


In order to use public key authentication with putty, you first need to download PuTTYgen. PuTTYgen allows you to generate a keypair to use for authentication with ssh servers. If you do not have the latest version of PuTTY, it is always a good idea to download the latest version.


Once you have downloaded PuTTYGen and you execute it, you will see a screen like this.


For nowadays ssh servers you will normally want to generate an RSA2 type key. The default keylength is 1024 - if you are really paranoid you may want to increase this, but it will slow things down a bit for you. With older servers you will most probably need to revert to the older RSA format.


On Windows™ you will need to move the mouse around in order to generate sufficient random noise to create a good key.


Save your key(s). I normally use the traditional unix type names for my ssh keys. For an old style rsa key i use 'identity' and 'identity.pub' for rsa2 keys i use 'id_rsa' and 'id_rsa.pub' and for DSA keys i use 'id_dsa.pub' and 'id_dsa'.

Once you have created and saved your keys, you should ssh into the servers you want to access and append the keys to your ~/.ssh/authorized_keys2 for RSA2 keys or ~/.ssh/authorized_keys for your RSA keys. If you really want to do it right secure copy the keys to the server using pscp.

At this point close out puttygen and open putty. Begin by creating a new connection in putty.




Add your Username on the server where you want to use ssh authentication.


Insert the key you put in your authorized_keys2 on the server.


Save the connection you just created


You should now be able to log onto the server using only your key's password or no password at all using ssh authentication. All of your data is encrypted !

SAFE GUARD your keys ! They can give access to the servers you use !


This Page is © Marina Brown - All Rights Reserved, Windows, Putty are Copyright and or Trademarked by their respective owners.