Hello to everyone,
Unfortunately i was forced to factory reset my phone and i didn't export my 2FA codes before hand.
I also have not saved my recovery codes or simply cannot find them.
From reading the docs i understand that if i have an SSH key i can still get my recovery codes through the
ssh git@bitbucket.org recovery_codes
command.
However i am quite new to git in general and have also been using the git client GitKracken (Linked to bitbucket).
Now, when i run the command from my terminal i get the
error, but my client is still connected to bitbucket and i can push/pull and clone just as before.
From my understanding, if GitKracken is connected to bitbucket then it must have saved an authorized SSH key somewhere and i should find that key and move it to my home/.ssh/ folder.
Is this correct or am i missing something obvious?
Any help would be appreciated because (client aside) i am locked out of my account.
Thanks a great lot to everyone!
And this is exactly the uselessness of 2FA for Bitbucket, because every other paid vendor provides some recovery option, even if by postal mail, in cases like this.
Hi Erika, I've never heard of postal mail being an option. As is the standard, we provide 3 ways of obtaining a code:
These options are widely used across different companies (Github and Google for example) and its advantages and risks are listed in many articles, like Don't get locked out when using 2FA.
There is no other way to obtain a code outside of these options. When you enable 2FA, you are committing to making that account accessible only to a user that is able to obtain a 2FA code. For more information you can see Retrieve recovery codes through SSH.
Please let us know if you have any other questions or there's something else I can help you with.
Regards,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You just talk about the steps assuming everything works as described in the article- https://confluence.atlassian.com/display/BITBUCKET/Two-step+verification?&_ga=2.247633607.1733967612.1540217663-1195139508.1537973354#Two-stepverification-RetrievearecoverycodethroughSSH
There can be tons of issues when you do that. I have spent more than a day trying to retrieve my recovery codes but still cannot. You talk about going to Bitbucket Avatar but nothing is accessible until I enter my verification code/recovery codes which cannot be retrieved. All I see is this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sagar, let me step in and help you.
You said you haven't been able to retrieve your recovery codes, why is that? Are you using the same machine where you have the SSH key to access your account? Please run the following command in your terminal and let us know if something goes wrong:
ssh git@bitbucket.org recovery_codes
You also said you can not access the Bitbucket Avatar, which is expected as you can only see it once you're logged in (not sure where you read about that). Navigating to the Bitbucket avatar is not needed during this process.
Let us know if you need further assistance!
Best regards,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All it says is "Permission denied (publickey)". I have add the keys using ssh-add and I see them when I do a ssh -add -l
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Justin! Looks like Bitbucket could not authenticate you, can you run this command from your terminal and show us the output? This will attempt to create a connection to Bitbucket for Git and tell you which username is using:
ssh -Tv git@bitbucket.org
You can also run this command to see which key is your SSH agent currently offering:
ssh-add -L
Note that with ssh-agent management Bitbucket uses the first key on the list.
From my understanding, if GitKracken is connected to bitbucket then it must have saved an authorized SSH key somewhere and i should find that key and move it to my home/.ssh/ folder.
Is this correct or am i missing something obvious?
Yes, that is correct. Please follow my instructions above and let us know your findings!
Best regards,
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ana,
Thanks for your answer.
The first command outputs a few lines where it seams it is attempting a connection to bitbucket but unfortunately it ends in:
debug1: No more authentication methods to try.
Permission denied (publickey).
The second command outputs:
The agent has no identities.
So it seams like my ssh client does not have the keys stored where it expects them to be.
But i can confirm that my git client (GitKraken) still has a working connection.
Thanks again,
Justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Justin, you'll need to find where the SSH key is stored and move it to the default location.
Regarding GitKraken, if still has a connection it could be because it has access to the SSH key somewhere, or maybe because the previous session hasn't been killed yet. If it's the first one, try to find where the SSH key is located. Otherwise, I'm afraid, you won't be able to obtain the recovery codes.
Let us know!
Ana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.