Git github不与google authenticator OSX合作

时间:2014-01-30 03:16:09

标签: macos git authentication github google-authenticator

所以我在我的电脑上运行git就好了。我的密码是用osxkeychain thingy保存的,一切都顺利进行。今天我决定我应该安全并在所有支持它的网站上启用Google身份验证器两步验证。有趣的是,github支持它,所以我进行了设置。它通过网站界面正常工作。我继续分支我正在研究的项目并做一些工作,然后我尝试推动新的分支。当我发现我的身份验证不起作用时,并不感到惊讶。让我感到惊讶的是,我似乎无法在谷歌上找到任何解决我问题的东西。

我最初的错误是:

git push --set-upstream origin binary-dev
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/***/***.git/'

然后我清除了我的旧密码,以获得交互式提示:

git credential-osxkeychain erase
host=github.com
protocol=https

这有助于摆脱我的旧设置,但现在我得到了:

git push --set-upstream origin binary-dev
Username for 'https://github.com': ***
Password for 'https://***@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/***/***.git/'

所以git本身似乎并不知道google身份验证器。我几乎无法找到任何相关信息。大约一半的页面是关于如何在网站上设置它,另一半是如何分叉实际的谷歌身份验证器源代码。但我对我的关键字可能不够有创意。可能也没有解决方案,但我不得不想知道为什么github提供双因素身份验证?是否有人像我一样被困在这里,并找到了出路?任何帮助都将非常赞赏。我只是希望git能够像我之前那样在github中添加2步auth之前的工作。

提前致谢,
最大

1 个答案:

答案 0 :(得分:1)

所以我开始工作的方式是绕过2步验证: https://help.github.com/articles/providing-your-2fa-security-code#through-the-command-line

感谢服务器故障中的“c4urself”。