Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

Unfortunately I didn't save the recovery codes or set up a backup phone number to receive codes by SMS, and I'm not signed in to Github and Bitbucket on any computer.

Is there another way to gain access to my Github and Bitbucket account?

like image 817
achiash Avatar asked Jan 05 '15 23:01

achiash


People also ask

How do you recover your GitHub account if you lost your 2FA credentials and recovery codes?

GitHub can send a password reset email to a verified address associated with your account. For more information, see "Updating your GitHub access credentials." Under "Having problems?", click Use a recovery code or request a reset. Type one of your recovery codes, then click Verify.

How do I restore my old 2FA?

Just use your authentication key (open your authentication application (app for 2FA) on your phone/device and manually enter the sixteen-character authentication key or scan the QR code you saved when enabling 2FA) to reinstall the 2FA codes in your authentication application and regain access to your account.

What do I do if I lost my backup codes?

If you lost your backup codes, you can revoke them and get new ones. Go to the 2-Step Verification section of your Google Account. Select Show codes. Select Get new codes.

Where are 2FA recovery codes saved?

The very best place to store your 2FA recovery codes is on a piece of paper you keep hidden in your home. At the bare minimum, this is what most people should be doing. This hiding spot could be a safe, a book, under the mattress, or wherever you consider a safe spot in your home.


2 Answers

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

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

ssh -T [email protected] verify 

And send the output to Github support. With that output they are able to disable your 2fa and allowing you to login just with your password.

The output should look like this:

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

If you are reading this it's probably too late for that advice but don't be stupid like I was. Save the recovery codes or set up a phone number!

like image 144
achiash Avatar answered Oct 06 '22 02:10

achiash


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

For github as @achiash mentioned you can use

ssh -T [email protected] verify

This will print the verification code on your screen.

For bitbucket you can use

ssh [email protected] recovery_codes

This will ask you for password. Enter the password and it will print your recover codes.

like image 33
Arjun Nayak Avatar answered Oct 06 '22 00:10

Arjun Nayak