Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH keys too short for Bitbucket: how to fix? (using sourcetree on windows)

So I am using sourcetree app and I'm using this guide (click here) for instructions on how to create a public key on my Windows machine.

When I copy the public key from Putty Key Generator into the SSH keys setting of Bitbucket, Bitbucket it complaining it's too short.

enter image description here

Looking back at Putty Key Generator, I am supposedly using 1024 bits.

enter image description here

I did notice that the public keys I'm seeing from the Putty app is much shorter than the ones I've gotten via ssh-keygen on my Mac/Ubuntu machines.

Any ideas what I could be doing wrong? Thank you

like image 382
mrjayviper Avatar asked Oct 18 '22 06:10

mrjayviper


2 Answers

I had the same problem.What i had to do was to change the number of bits at the very bottom..from 1024 to 2048.Then when I copied and add the new key to bitbucket it was long enough..

like image 183
NelsonRoberts Avatar answered Oct 21 '22 09:10

NelsonRoberts


To generate your key, use <path\to\git>\usr\bin\ssh-keygen.exe, packaged with git-for-windows/git latest release:

ssh-keygen -t rsa -f %USERPROFILE%\.ssh\id_rsa -C "key for GitLab access" -q -P ""

That will generate a correct key, without passphrase (at least for testing).
Make sure you don't need id_rsa(.pub) in your %USERPROFILE%\.ssh folder, if you had those keys before using the command above.

like image 21
VonC Avatar answered Oct 21 '22 09:10

VonC