Skip to main content

About two-factor authentication

双重身份验证 (2FA) 是登录网站或应用时使用的额外保护层。 With 2FA, you have to log in with your username and password and provide another form of authentication that only you know or have access to.

For GitHub Enterprise Cloud, the second form of authentication is a code that's generated by an application on your mobile device or sent as a text message (SMS). After you enable 2FA, GitHub Enterprise Cloud generates an authentication code any time someone attempts to sign into your account on The only way someone can sign into your account is if they know both your password and have access to the authentication code on your phone.

配置 2FA 后,使用基于时间的一次性密码 (TOTP) 移动应用 ,或通过短信 添加安全密钥,例如指纹读取器或Windows Hello。 启用安全密钥身份验证的技术称为 WebAuthn。 WebAuthn 是 U2F 的继承者,适用于所有现代浏览器。 有关详细信息,请参阅“WebAuthn”和“是否可以使用。”

In addition to security keys, you can also use GitHub Mobile for 2FA after configuring a TOTP mobile app or text messages. GitHub Mobile uses public-key cryptography to secure your account, allowing you to use any mobile device that you've used to sign in to GitHub Mobile as your second factor.

You can also configure additional recovery methods in case you lose access to your two-factor authentication credentials. For more information on setting up 2FA, see "Configuring two-factor authentication" and "Configuring two-factor authentication recovery methods."

We strongly urge you to enable 2FA for the safety of your account, not only on GitHub Enterprise Cloud, but on other websites and apps that support 2FA. You can enable 2FA to access GitHub Enterprise Cloud and GitHub Desktop.

For more information, see "Accessing GitHub using two-factor authentication."

Two-factor authentication recovery codes

配置双重身份验证时,您将下载并保存双重身份验证恢复代码。 如果无法访问您的电话,您可以使用恢复代码向 GitHub Enterprise Cloud 验证。 For more information, see "Recovering your account if you lose your 2FA credentials."

Warning: 出于安全原因,如果您丢失了双重身份验证的凭据或无法访问您的帐户恢复方法,GitHub Enterprise Cloud 支持人员可能无法帮助您恢复访问启用了双重身份验证的帐户。 For more information, see "Recovering your account if you lose your 2FA credentials."

Requiring two-factor authentication in your organization

Organization owners can require that organization members, billing managers, and outside collaborators use two-factor authentication to secure their personal accounts. For more information, see "Requiring two-factor authentication in your organization."