这就是为什么我必须面对这个两个因素的问题:the GitHub announcement
最佳答案
我看过很多关于这个问题的链接,但是,由于信息分散,我决定用对我有用的步骤进行总结。
首先,这是我在 how to set the two-factor security in github.com 上找到的最佳链接
这是我为我的 token 设置的(如果您选择的权限少于所需的权限,无论 token 没问题,访问也会失败)
这里的关键是使用新 token 代替您的用户密码。但因为我只是从 github.com 存储库中获取所有更改,所以我已将凭据保存在本地。我必须承认这是不推荐的,因为安全性(在 Linux 中,这是以纯文本设置的,这是一个非常糟糕的做法),但我们开始......
这是关于 how to set git credentials on local 的链接
现在,您必须在此处设置凭据:文件是 ~/.git-credentials
yyyyyy@xxxxxx:~$ cat .git-credentials
https://put-your-github-user-here:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="403035346d392f35346d342f2b252e6d28253225002729342835226e232f2d" rel="noreferrer noopener nofollow">[email protected]</a>
Another example on what to do in this file
这是一个link about the format for this file
设置完所有这些内容后,尝试检查存储库状态或获取本地的任何更改。
关于linux - 如何从命令行设置 ubuntu (linux) 使用 github.com 的双因素身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65391340/