Skip to main content

此版本的 GitHub Enterprise 已停止服务 2022-10-12. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

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."

  1. Type your username and password to prompt authentication.

    Warning: 如果使用双重身份验证保护个人帐户,但不知道密� �,则� 法按照以下步骤恢复帐户。 GitHub 可以将密� �重置电子邮件发送到与帐户关联的已验证地址。 有关详细信息,请参阅更新 GitHub 访问凭据

  2. On the 2FA page, under "Don't have your phone?", click Enter a two-factor recovery code.

    Screenshot of link to use a recovery code

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

    Field to type a recovery code and Verify button

Authenticating with a security key

If you configured two-factor authentication using a security key, you can use your security key as a secondary authentication method to automatically regain access to your account. For more information, see "Configuring two-factor authentication."