linux - 如何从命令行设置 ubuntu (linux) 使用 github.com 的双因素身份验证

标签 linux git ubuntu github two-factor-authentication

这就是为什么我必须面对这个两个因素的问题:the GitHub announcement

最佳答案

我看过很多关于这个问题的链接,但是,由于信息分散,我决定用对我有用的步骤进行总结。

首先,这是我在 how to set the two-factor security in github.com 上找到的最佳链接

这是我为我的 token 设置的(如果您选择的权限少于所需的权限,无论 token 没问题,访问也会失败)

github.com token creation page

这里的关键是使用新 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/

相关文章:

linux - 是否可以编译一个 Crystal 脚本,以便它可以在任何 Linux 机器上运行,而无需用户下载 Crystal

git - 如何在不丢失历史记录的情况下将多个提交 merge 为一个

ruby-on-rails - 为什么新服务器上有 "PG::UndefinedFunction: ERROR: function gen_random_uuid() does not exist"而旧服务器上没有?

linux - 我的电脑支持 OpenGL 2.1 吗?

linux - 在 RedHat 上安装 opensips cachedb_redis 时出错

git - 如何在 git 历史中查找/识别大型提交?

python - 错误: 502 bad gateway in flask app on nginx and uwsgi

bash - 使用 Sed 读取目录中的最后 6 行

c++ - 在 Linux 系统调用中的 C 程序中出现错误 ‘\342’ stray ‘\210’ stray ‘\222’

android - 推送后在 Github 上保护 API key