> 技术文档 > 解决github因双重认证2FA丢失而无法登录的问题 - 如何通过github-recovery-codes.txt辅助登录github?

解决github因双重认证2FA丢失而无法登录的问题 - 如何通过github-recovery-codes.txt辅助登录github?


效果图

1. 使用github-recovery-codes.txt辅助登录github (手机2FA码无法获取的情况下

2. 重置丢失的Github的2FA(two-factor authentication)认证,在手机app上,Microsoft Authenticator

实现步骤

使用github-recovery-codes.txt辅助登录github (手机2FA码无法获取的情况下)

  1. 找回当初在github开启2FA时,github叮嘱我们保存好的“GitHub 恢复代码”,文件名:
    github-recovery-codes.txt
    建议保存到云盘、微信收藏、邮箱附件

     
  2. 复制其中一行
     
  3. 尝试使用账号+密码登录github
    https://github.com/login
    账密正确,提示需要输入“Authentication code”
    但是刚好 手机重置导致TOTP软件丢失,例如软件“Microsoft Authenticator”,那么,切换使用“GitHub 恢复代码” - “github-recovery-codes”来登录,如下一步骤:
     
  4. 点击底部 “Use a recovery code or begin 2FA account recovery

     
  5. 输入github-recovery-codes.txt的其中一行,即可跳过2FA登录到github

     

如何重置丢失的Github的2FA(two-factor authentication)认证,在手机app上,例如Microsoft Authenticator?

  1. 手机下载安装app “Microsoft Authenticator
     
  2. 打开
     
  3. 使用微软账户登录
     
  4. 登录到github (参考上述“使用github-recovery-codes.txt辅助登录github (手机2FA码无法获取的情况下)”)
     
  5. github > 账号设置 > Password and authentication > Authenticator app > 右边Edit

     
  6. 使用“Microsoft Authenticator扫码添加github记录,例如:

    扫码后:

    将实时的码,回填到github设置页的“Verify the code from the app”,显示ok!
     
  7. 记得点击Save按钮!

     

  8. 尽情使用2FA登录github吧!
     
  9. 下次登录时,填写账号+密码+时刻会弹出:

    建议:Ask Me Later
     
  10. ok!

ending...