Putty using ssh keys
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.
- Load your key, mine is called id_dsa. Enter your passphrase.
- 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.
- Start Putty.
- Go to Connections - SSH - Auth to Browse for the newly generated key. (id_dsa.ppk)
- 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:
- Start the agent by double clicking it.
- Double click the terminal-with-hat icon in the right bottom taskbar area.
- Add Key. Enter your passphrase just once for this whole session.
- Close the Pagent, it will remain active in the taskbar.