Generate new recovery codes using SSH

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.

  1. In a console/terminal, run ssh git@gitlab.com 2fa_recovery_codes.
  2. Answer 'yes' when asked whether you wish to generate new recovery codes.
  3. Copy one of the recovery codes.
  4. 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.
  5. After successfully authenticating, go to Profile -> Account.
  6. Disable two-factor authentication.
  7. 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.

Was this article helpful?
0 out of 1 found this helpful