现在打开 GitHub 会要求有代码提交的用户开启两步验证,否则后面提交不了代码
Because of your contributions on GitHub, two-factor authentication will be required for your account starting Sep 28, 2023. Thank you for helping keep the ecosystem safe! Learn more about our two-factor authentication initiative.
Because of your contributions on GitHub, two-factor authentication will be required for your account starting Oct 6, 2023. Thank you for helping keep the ecosystem safe! Learn more about our two-factor authentication initiative.
GitHub 提供了两种方式:身份验证器应用或手机短信验证
但是从官方文档可知,GitHub 手机短信验证不支持中国号码,所以没有国外号码的话只能考虑 TOTP 应用或浏览器扩展
TOTP应用
以微软的 Authenticator 为例
GitHub 右上角选择【设置】,或者打开 https://github.com/settings/security
页面拉到底点击
Enable two-factor authentication
打开的页面会显示一个二维码打开 Authenticator 应用,从右上角的 + 号添加帐户,选择其他帐户,然后扫一扫二维码
扫描完成之后帐号就添加到 Authenticator 中了,下次打开切到 GitHub 即可展示动态验证码
浏览器扩展
以开源免费的 Authenticator: 2FA Client 为例
- GitHub 右上角选择【设置】,或者打开 https://github.com/settings/security
- 页面拉到底点击
Enable two-factor authentication
打开的页面会显示一个二维码 - 点击扩展上的扫描按钮,用鼠标选中二维码,即可添加 GitHub帐号
开源地址:https://github.com/Authenticator-Extension/Authenticator
Edge扩展:Authenticator: 2FA Client - Microsoft Edge Addons
Chrome扩展:身份验证器 - Chrome 应用商店