gpt4 book ai didi

混帐 "fatal: Authentication failed for ' http :. 。来自 Microsoft Visual Studio Team Foundation Server 的 .'"

转载 作者:太空宇宙 更新时间:2023-11-03 17:05:03 25 4
gpt4 key购买 nike

我将我的 Ubuntu 升级到 18.10(从 17.10)。现在我无法再从 CLI 连接到我项目的 Microsoft Visual Studio Team Foundation Server(版本 16.131.27701.1)。 (我已经两周没有在存储库上工作了。所以我不知道服务器端是否也同时发生了变化。)

$ git fetch
Username for 'http://....net:8080': NUNNI
Password for 'http://NUNNI@....net:8080':
fatal: Authentication failed for 'http://....net:8080/tfs/AE/_git/AE-VMT/'

(是的,它不是 HTTPS,而是通过某些 VPN。)

很遗憾,我找不到对我的情况有帮助的答案。

一些研究表明:

$ GIT_CURL_VERBOSE=2 git fetch
...
< WWW-Authenticate: Bearer
< WWW-Authenticate: Negotiate
< WWW-Authenticate: NTLM
...

看来,协商(Kerberos 或 NTLM)或 NTLM 已宣布通过 HTTP header 进行身份验证。

curl --negotiate "http://NUNNI:<password>@....net:8080/tfs/AE/_git/AE-VMT"

不起作用; HTML 标题元素是:

TF400813: Resource not available for anonymous access. Client authentication required. - Microsoft Team Foundation Server

鉴于

curl --ntlm "http://NUNNI:<password>@....net:8080/tfs/AE/_git/AE-VMT"

工作正常。

据我了解https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/understanding-http-authentication , Negotiate 优先于 NTLM

所以对我来说,在这种情况下,cURL 似乎不适用于 Negotiate。 (据我对 MS 文档的理解,连接应该优先使用 Kerberos(如果可用),如果 Kerberos 不可用则回退到 NTLM。)

问题:

  • 如何检查服务器端或我的本地 cURL 是否不支持 Kerberos。
  • 是否有一个选项可以强制 git 使用 NTLM 而不是 Negotiate。 (我在不同的 stackoverflow 文章中阅读了一些关于 HTTP/NTLM 代理的内容,但是当我尝试将 Git 存储库配置为 NTLM 代理时它不起作用 - 我真的没想到它会起作用。)
  • 对于解决问题或获取更多详细信息的任何其他想法?

非常感谢!

最佳答案

如果您使用用户名和密码,则您明确使用 Kerberos。使用用户名和密码进行 HTTP 身份验证与 Kerberos 正交。

How can I check if Kerberos is not supported by the server-side or my local cURL.

运行 klist -5fea 查看您是否有 Kerberos 票证。如果是这样,您应该能够 curl --negotiate 无需指定用户名和密码; curl 将使用您的 Kerberos 票证进行身份验证。如果您没有票,则需要使用 NTLM 并使用用户名和密码,或者使用个人访问 token (PAT)。

Is there an option to force git to use NTLM instead of Negotiate.

是的,使用用户名和密码应该明确禁用协商。

Any other ideas to solve the issue or get more details what's going on?

设置 GIT_CURL_VERBOSE=1GIT_TRACE=1 环境变量。

关于混帐 "fatal: Authentication failed for ' http :. 。来自 Microsoft Visual Studio Team Foundation Server 的 .'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54180923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com