Using your OpenSSH private key in Putty

When you are working with private (and public) keys generated by OpenSSH, you will have files called id_dsa and id_dsa.pub. These files can't be used in Putty directly. Instead they need to be converted to something else using PuTTYgen, also available from the Putty page. To do this, follow these simple steps. Lets assume you already have Putty installed on your Windows machine.

  1. Download PuTTYgen.
  2. Load your key, mine is called id_dsa. Enter your passphrase.
  3. Save the private key, I saved mine as id_dsa.ppk.

Your original private key (id_dsa) is now converted and saved as a putty private key. (id_dsa.ppk) There are now two things you might want to do, using it directly, or using it with an agent.

Using the converted key directly in Putty

This is the simplest, but requires you to type your passphrase each time you are connecting to a machine.

  1. Start Putty.
  2. Go to Connections - SSH - Auth to Browse for the newly generated key. (id_dsa.ppk)
  3. Optionally save this session and Open the connection.

Using the converted key in Pagent

You might want to use an SSH Agent like Pagent to store your key over multiple sessions. This will make your life easier when you connect to multipple machines. In order to do so:

  1. Download Pagent.
  2. Start the agent by double clicking it.
  3. Double click the terminal-with-hat icon in the right bottom taskbar area.
  4. Add Key. Enter your passphrase just once for this whole session.
  5. Close the Pagent, it will remain active in the taskbar.

One final note; on the machines you are connecting to, you don't need to change/convert any keys, simply use the public key (id_dsa.pub) as generate by OpenSSH in ~/.ssh/authorized_keys.

Comments

Great article! But it's

Great article! But it's Pageant, not Pagent. You might want to fix that.

About Consultancy Articles Contact




References Red Hat Certified Architect By Robert de Bock Robert de Bock
Curriculum Vitae By Fred Clausen +31 6 14 39 58 72
By Nelson Manning [email protected]