Is there a way to recover Github and Bitbucket 2FA without recovery codes or a backup phone number?

My Android device broke and I lost access to the Github and Bitbucket 2 factor authentication codes.

Unfortunately, I did not save the recovery codes or did not create a backup phone number for receiving codes via SMS, and I was not connected to Github and Bitbucket on any computer.

Is there any other way to access my Github and Bitbucket account?

+44
bitbucket github
Jan 05 '15 at 23:51 on
source share
2 answers

Luckily for me, there is a way to do this if you have assigned an SSH key to your account.

What you need to do is run this command on the computer where you have the SSH key:

ssh -T git@github.com verify 

And send the output to Github support. With this output, they can disable your 2fa and only allow you to log in with your password.

The result should look like this:

 Please provide the following verification token to GitHub Support. 002de4e72d08f47b0b828bab0224dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf6174ce54ab0040aa7075626c69635f6b6579ce008cacf9 

If you read this, it may be too late for this advice, but don't be stupid like me. Save recovery codes or set up a phone number!

+82
Jan 05 '15 at 23:51 on
source share

This only works if you have access to your bitpacket and github via SSH. Even for @achiash's answer.

For github as mentioned by @achiash you can use

ssh -T git@github.com verify

A confirmation code will be printed here on your screen.

For a bit bag you can use

ssh git@bitbucket.org recovery_codes

This will ask for a password. Enter your password and print recovery codes.

+1
Jul 03 '17 at 10:37
source share



All Articles