Use PuTTY Key Generator to Create Your Keys

We can use PuTTYgen to create a private/public key pair. Start it by double-clicking its executable file. Make sure you select SSH-2 RSA under type of key to generate and specify the number of bits in a generated key (the default value is fine), then click on Generate and follow the instructions.

Now a private/public key pair has been generated. Under key comment, you can enter any comment; normally you use your email address here. Then, optionally, specify a key passphrase and repeat it under confirm passphrase. You'll need that passphrase to log in to SSH with your new key. Then click on save public key and save it in some safe location on your computer. You are free to choose a filename and extension, but it should be one that lets you remember for which system it is.

Next, click on save private key. You can save it in the same location as the public key - it should be a location that only you can access and that you don't lose! (If you lose the keys and have disabled username/password logins, then you can't log in anymore!) Again, you're free to choose a filename, but this time the extension must be .ppk.

4

Copy Your Public Key to Ubuntu

In the SSH session you left open from step 2, we're going to create your SSH directory and copy your public key into it.

In PuTTYgen, copy the public key and then paste it into your SSH session (right-click). You can then save and exit the file. Then we'll apply permissions so that the file is only read/writeable by the current user:
chmod 600 ~/.ssh/authorized_keys

5

SSH with Keys

Open a new PuTTY session (pro tip: click the PuTTY icon in the top left corner of your current PuTTY session and select 'New Session'). In the PuTTY configuration window go to Connection > SSH > Auth and browse to where you saved your private key and select it. Go back up to Session and connect to your server.

After entering your username, you should be connected to your server with SSH keys. After verifying that everything works, save your PuTTY session settings to make reconnecting quick.