Getting "That access key is invalid." when adding an SSH key

Darrell Brogdon December 8, 2019

I'm following the instructions for adding a new SSH key to my repo but no matter what I do I keep getting the error: "That access key is invalid."

2 answers

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 8, 2019

Hello @Darrell Brogdon,

Thanks for reaching out.

Aren't you trying to register your private key by any chance, not the public one? You'll get this error if you try adding your private key. You should be adding the corresponding public key to Bitbucket.

Bitbucket supports four encryption algorithms for SSH keys: Ed25519, ECDSA, RSA, and DSA. The message you mentioned generally means that your key isn't using one of these algorithms or is malformed.

Hope this helps.

Cheers,
Daniil

jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 9, 2019

The key may also be in an unrecognized format, or it may be the wrong size (RSA keys must be at least 2048 bits; ECDSA must be 256, 384, or 521 bits; and DSA must be 1024 bits but don't use that because it's quite insecure).

Like # people like this
0 votes
freelensia March 3, 2020

Did you solve this problem successfuly @Darrell Brogdon ? 

I pasted the data below to the textbox  (some letters replaced with XXX)

ssh-rsa
AAAAB3NzaC1yc2EAAAABJQAAAQEAk/ugnFio9rj3+fkMaNwYz5miM1xjAEsePmfQQXTk25ug/EljYLBNFXpZys/UljEC+SFaydgUnEPMq/r8QgI8VajsJqutG8jMosFyvk65wgL2RzEyZdHvTtsxyuhVr6DvHtT6A4Jm6WwL1sq2lzRORh6GX1MIt7MzW2+2gCYZ8OvPfJxFfBh0bDBvUl4ebvhk8bDCtD7BH+VeT7xd13LdL54UxnD/FuaeAemXkP9E6V6RTMleR9wsXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXj2rf2EaiNsl5mS+fLNzSkt6UNCaH4Nwp8vXU7EIBCSo+ySy87j6UE+8B/FJwQ==

This was generated with Putty Agent, RSA 2048 bits. I put the word ssh-rsa at the top. The key name is @"20202_XXXLaptopDevMachine". Same error @"That access key is invalid."

 

@jredmond @Daniil Penkin 

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 3, 2020

Hello @freelensia,

I put the word ssh-rsa at the top

I'm not sure what you meant here. The public key should be a single line, like this:

ssh-rsa <encoded key> <optionally, your email>

It's hard to tell what is wrong with your key given that you replaced some letters there, so I can't validate it. It is actually safe to publish your public key – that's why it is called public. What you should never share is your corresponding private key.

The safest option is just to find the key file on your disk, open it with a text editor and copy the content.

Hope this helps.

Cheers,
Daniil

freelensia May 11, 2020

Thanks @Daniil Penkin , the problem was that I tried to copy the key from a text editor. This was not accepted by Bitbucket. I needed to load the key via PuttyGen Agent then copy the text generated there. This was not mentioned in the guide at https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html.

Thanks for offering to help.

Like zukrac likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events