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?
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.
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.
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.
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.
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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With