Skip to main content

Recovering your account if you lose your 2FA credentials

If you lose access to your two-factor authentication credentials, you can use your recovery codes, or another recovery option, to regain access to your account.

Using a two-factor authentication recovery code

Use one of your recovery codes to automatically regain entry into your account. You may have saved your recovery codes to a password manager or your computer's downloads folder. The default filename for recovery codes is github-recovery-codes.txt. For more information about recovery codes, see Configuring two-factor authentication recovery methods.

Note

If you do not know your password, you can use a recovery code after requesting a new password. See Updating your GitHub access credentials.

  1. Navigate to http(s)://HOSTNAME/login.

  2. To prompt two-factor authentication, type your username and password, then click Sign in.

  3. Under "More options", click 2FA recovery code.

  4. Type one of your recovery codes, then click Verify.