gpt4 book ai didi

java - 在 URL 上的 Conduit 上检测到 Winrm4j 授权循环,领域为 "null"

转载 作者:行者123 更新时间:2023-11-30 06:30:19 25 4
gpt4 key购买 nike

我使用下面的代码连接到 Windows 2008 服务器。

WinRmTool.Builder builder = WinRmTool.Builder.builder("hostname", "domain\username", "password");
builder.setAuthenticationScheme(AuthSchemes.NTLM);
builder.useHttps(false);
WinRmTool tool = builder.build();
tool.executePs("COMMAND");

我遇到了异常

Caused by: java.io.IOException: Authorization loop detected on Conduit "{http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd}WinRmPort.http-conduit" on URL "http://hostname:5985/wsman" with realm "null"

我无需在浏览器中进行任何身份验证即可访问 WS“http://hostname:5985/wsman”,Windows 服务器上的 winrm 服务设置如下。

   AllowUnencrypted = false
Auth
Basic = false
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986

我的客户端设置也相同。 HTTPS 访问 winrm WS 不起作用,因此我使用 useHttps(false)。

客户端和服务器位于不同的域中。我能够使用提供的主机名、域\用户名和密码成功 rdp 到服务器。

我尝试将身份验证方案更改为 kerberos/basic/digest。它们似乎都不起作用。我在两边都尝试了“allowUnencrypted=true”,但仍然不起作用。

我是否缺少任何conf/prop 文件?

最佳答案

在远程服务器上配置以下设置后,相同的代码可以工作

winrm set winrm/config/service/Auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'

关于java - 在 URL 上的 Conduit 上检测到 Winrm4j 授权循环,领域为 "null",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46299280/

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