Configuring SSH Keys on Windows
Unfortunately Windows does not come with the extensive array of tools that Linux and other open source operating systems do. However, there are some open source tools that allow us to accomplish the same things.
One of the things that Windows has no native support for is SSH and SSH keys. Launchpad uses SSH keys to authenticate your computer with your Launchpad account. This guide shows you how to get that done.
Getting SSH on Windows
PuTTY is a free implementation of Telnet and SSH for Windows, along with an xterm terminal emulator. It is written and maintained primarily by Simon Tatham. You will need to download the PuTTY Windows installer (we don't need PuTTYtel) and install on your computer.
PuTTY contains an SSH client, as well as utilities to generate SSH keys and allow an SSH connection between your computer and a server to authenticate you based on your SSH key.
The first thing you need to do is generate your SSH keypair. A keypair, as the name implies, consists of 2 parts: the public key and the private key.
Your public key is placed on remote servers so that they can check back with you to see that you are who you say you are.
Your private key should NEVER leave your computer! This is the main file that authenticates you. It contains the special unique data that identifies you.
Generating a Keypair
Generating a keypair with PuTTY is very easy.
- Launch PuTTYgen
- Give your key a nice name (on Unix systems it's <username>@<pc_name>)
- At the bottom, select SSH2 RSA
- Set the bits to 4096
- Click the Generate button
- Click the Save private key button and save your private key to somewhere safe on your computer
- Don't close PuTTYgen just yet!
Launchpad & SSH
Like I said before, when you use Launchpad and Bazaar, it likes to use the SSH keys to authenticate you. Once again, PuTTY comes to our rescue.
Adding Your Public Key to Launchpad
- Select the text in the box that appears at the top of PuTTYgen
- Open your browser to Launchpad and log in
- Go to your home page and click on the Change details link
- Click on the SSH Keys tab
- Paste that public key into the text box at the bottom of the page
- Click the Import Public Key button at the bottom of the page
Using Pageant For SSH Key Auth
Unfortunately uploading your public key to Launchpad on it's own is not enough. You also need to make sure Launchpad can speak to your private key.
- Run Pageant (you'll see a little icon of a computer with a hat appear in your system tray
- Right-click on the icon and click View Keys
- Click the Add key button and find your private key
- Click the Close button, and you're all ready!
In order to get Pageant to start and load your key automatically.
- Create a shortcut to Pageant in your Windows Startup menu
- Right click on that shortcut and bring up the Properties
- Change the target to add the path of your ppk file as an argument:
"C:\Program Files (x86)\PuTTY\pageant.exe" "C:\Users\username\Documents\privatekey.ppk"