If you previously added an SSH public key to your profile, you can generate new recovery codes via SSH. Follow the steps below to recover your account.
- In a console/terminal, run
ssh firstname.lastname@example.org 2fa_recovery_codes.
- Answer 'yes' when asked whether you wish to generate new recovery codes.
- Copy one of the recovery codes.
- Sign in to https://gitlab.com using your normal username and password. When asked for a two-factor authentication code, paste the recovery code you copied previously.
- After successfully authenticating, go to Profile -> Account.
- Disable two-factor authentication.
- Re-enable two-factor authentication with a new device (Google Authenticator, Duo Security, etc.).
Account recovery information: https://about.gitlab.com/support/#account-recovery
If this process does not work for you, please go ahead and open a support ticket.