我的 GitHub 帐户设置了 2 因素身份验证,但在克隆存储库时 username/password 没有被请求

My GitHub account is set up with 2 factor authentication, yet username/password aren't requested when cloning a repository

我的 GitHub 帐户设置了 2 因素身份验证

未列出任何个人访问令牌

然而,我能够在不要求输入用户名或密码的情况下克隆存储库。

怎么会?

在 github 中,你的所有项目都是 public,除非你支付私人回购费用。
拥有 github 帐户的任何人都可以克隆您的项目。

2 种身份验证是为了保护您的帐户而不是您的项目,因为它们都是 public。

如果您想要私有存储库,请使用 bitbucket。您可以在那里拥有私有存储库。


https://help.github.com/articles/about-two-factor-authentication/

After 2FA is enabled, GitHub generates an authentication code any time someone attempts to sign into your GitHub account.

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.