git提示密码自更新为2.36.1
我们多年来使用了Git的GitLab安装多年。我们有SSH键设置,因此简单的git push
不会提示获得凭据。
由于更新为2.36.1,因此我们现在正在提示我们在git push
上获取密码。麻烦是,我们启用了MFA,因此提供密码不起作用。
我不知道这是否相关,但是我们也被警告说,存储库是其他人所有的,并遵循该建议git config -global -global -add safe.directory *foldername *
i 've尝试添加一个新的RSA SSH键,但没有帮助。
有什么想法吗?
we have been using git for years with a local gitlab installation. We have ssh keys setup, so a simple git push
would not prompt for credentials.
since updating to 2.36.1, we are now being prompted for a password on git push
. trouble is, we have MFA enabled, so providing the password doesn't work.
I don't know if this is relevant, but we were also warned that the repository was owned by someone else and followed the suggestion to git config --global --add safe.directory *foldername*
I've tried adding a new RSA ssh key and it hasn't helped.
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
密码或MFA(意味着将令牌作为密码)仅与HTTPS URL有关。
对于SSH,如果创建了私钥加密,则可能需要处理密码。
因此,首先检查什么
git Remote -v
返回存储库中的内容。如果它实际上是HTTPS,请检查
git config -global recertential.helper
的输出:它可能已为您的gitlab帐户缓存了一个过时的密码。A password or MFA (meaning using a token as a password) should only be relevant for an HTTPS URL.
For an SSH one, you might need to deal with a passphrase, if your private key was created encrypted.
So check first what
git remote -v
returns inside your repository.If it is actually an HTTPS one, check the output of
git config --global credential.helper
: it might have cached an obsolete password for your GitLab account.使用
ssh -Vt
表明我的RSA密钥正在尝试,并且GIT正在回到密码。
我添加了一个新的ED25519键,其中
ssh -keygen -T ED25519
它起作用!因此,新版本的Git不喜欢我的旧RSA键?
编辑:即使我添加了一个新的RSA密钥和 Thought 我已经配置了SSH来使用它,但冗长的测试表明它没有被尝试。因此,要么根本不喜欢RSA键,要么,如果我给它默认名称,那么新的RSA键也会奏效。
doing a verbose test with
ssh -vT [email protected]
showed that my rsa key was being attempted and that git was falling back to password.
I added a new ed25519 key with
ssh-keygen -t ed25519
and it works! so the new version of git doesn't like my old RSA key?
EDIT: even though I added a new RSA key and thought I had configured ssh to use it, the verbose test showed that it wasn't being tried. So either it doesn't like RSA keys at all, or a new RSA key would have worked just as well if I'd given it the default name.