I have lost my Phone and do not have the recovery code for my 2FA for GitLab.
So I am locked out of my account.
What are my options?
To use a recovery code, enter your username/email and password on the GitLab sign-in page. When prompted for a two-factor code, enter the recovery code. Once you use a recovery code, you cannot re-use it. You can still use the other recovery codes you saved.
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 know your password for GitHub.com but don't have the two-factor authentication credentials or your two-factor authentication recovery codes, you can have a one-time password sent to your verified email address to begin the verification process and regain access to your account.
I know this is an old question, but the following, which I have tested only with gitlab.com free hosted accounts, may be useful for others with GitLab 2fa problems.
IF
THEN ...
You can create a brand new list of recovery codes via ssh:
ssh [email protected] 2fa_recovery_codes
Answer the questions and save the list of recovery codes somewhere safe this time! I'm guilty of all of the above and this solution provided by GitLab is both simple and elegant.
Source: https://gitlab.com/gitlab-org/gitlab-ce/issues/3765
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