如何为 GitHub 开启两步验证

两步验证能在密码泄露时依然保护你的 GitHub 仓库与组织安全。GitHub 强烈建议所有开发者开启两步验证。

  1. 登录 GitHub,点击头像选择Settings
  2. 在侧边栏选择Password and authentication
  3. Two-factor authentication下点击Enable two-factor authentication
  4. GitHub 会显示二维码,用 Authenticator App 扫描。
  5. 输入应用中的 6 位验证码完成校验。
  6. 下载并妥善保存恢复码(recovery codes),然后点击Done

提示:恢复码是设备丢失后找回 GitHub 账户最快的方式——请保存到密码管理器或离线介质中。