在github上启用2FA时使用密码而不是标记 [英] Use password instead of token with 2FA enabled on github

查看:1157
本文介绍了在github上启用2FA时使用密码而不是标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在github上激活了2FA,现在我所有电脑上的所有本地存储库都停止工作(我通过https使用它们)。我似乎必须切换到SSH或创建个人访问令牌。



我的git设置配置的方式是从不要求用户名,但始终要求密码时做拉/推,我不想改变,但我也不想写我的个人访问令牌,每次我做git推/拉。



<理想的情况是只需要询问一次我的2FA代码,然后只询问我的密码(就像记住我的电脑一样)。我做错了什么?

解决方案

我不认为有像您正在搜索的解决方案。我认为你最好的选择是生成一个ssh密钥并将其添加到Github。这是一个非常简单的过程,只需按照以下链接: https://help.github.com/enterprise/2.9/user/articles/generating-a-new-ssh-key-and-adding-it如果你不想把所有的repo url改为ssh,你可以运行:$ b $ sb-agent -a / $ / $>

b
git config --global url。git@github.com:。而不是https://github.com/

这指示git拉和推送到ssh url而不是https。


I recently activated 2FA on github and now all my local repositories in all my computers stopped working (I use them over https). It seems that I have to either switch to SSH or create a Personal access token.

The way my git settings are configured is that never ask for the username but always ask for password when doing pull/push, and I don't want to change that but I also don't want to write my personal access token everytime I do git push/pull.

The ideal thing will be asking for my 2FA code just once and then only asking me for my password (something like remembering my computer). Am I doing something wrong?

解决方案

I don't think there is a solution like the one you are searching. I think your best choice would be to generate an ssh key and add it to Github. It is a very easy process, just follow this link: https://help.github.com/enterprise/2.9/user/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

If you don't want to change all your repo urls to ssh, you could run: git config --global url."git@github.com:".insteadof https://github.com/ This instructs git to pull and push to the ssh url rather than https.

这篇关于在github上启用2FA时使用密码而不是标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆