Here is a quick cheat sheet on how to add a proper ssh key for Sourcetree / Bitbucket from a Windows system with the PuTTY Key Generator.
The process is not complicated by any means, but getting things mixed up simply results in Bitbucket or Sourcetree rejecting the key, making tracking down the problem more difficult than it should be.
- Press Generate to create the key.
- Press Save private key to save the private key to disk.
- Copy the public key from the text area box above into the clipboard.
- Paste the public key into the Bitbucket > Settings > SSH Keys section on the website.
If you need to retrieve the key, you can open the ppk file and:
- Copy the public key lines.
- Remove the line breaks.
- Add ssh-rsa to the beginning of the line.
- Add rsaa-key-20190326 (or whatever it says under Comment:) at the end of the line.
Make sure that the whole public key doesn't have a single line break!