【问题标题】:Connect to remote server using winrm without adding the server to TrustedHosts使用 winrm 连接到远程服务器而不将服务器添加到 TrustedHosts
【发布时间】:2012-09-26 15:28:32
【问题描述】:

我一直在努力处理 winrm 和 TrustedHosts 但无济于事。经过一些试验,我发现 winrm/config/client 的这个字段最多只能有 1023 个符号,这还不够,特别是如果通过它们的 ipv6 添加主机。 我引用Installation and Configuration for Windows Remote ManagementA trusted hosts list should be set up when mutual authentication cannot be established.

同样在同一个文件中,文本说:Other computers in a workgroup or computers in a different domain should be added to this list. 所以我认为这意味着只要两台计算机在同一个域中,我应该能够使用 winrm 从另一台访问其中一台。

我尝试将两台计算机添加到测试域并执行:

winrm 获取 winrm/config/client -r:192.168.100.1 -u:user -p:pass

从其中一个到另一个,但失败并出现错误:

WSManFault
    Message = The WinRM client cannot process the request. If the authentication
 scheme is different from Kerberos, or if the client computer is not joined to a
 domain, then HTTPS transport must be used or the destination machine must be ad
ded to the TrustedHosts configuration setting. Use winrm.cmd to configure Truste
dHosts. You can get more information about that by running the following command
: winrm help config.

Error number:  -2144108316 0x803380E4
The WinRM client cannot process the request. If the authentication scheme is dif
ferent from Kerberos, or if the client computer is not joined to a domain, then
HTTPS transport must be used or the destination machine must be added to the Tru
stedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. You ca
n get more information about that by running the following command: winrm help c
onfig.

将 192.168.100.1 添加到 TrustedHosts 后,上述查询成功。所以我的问题是:是否可以在不修改 TrustedHosts 的情况下在两台主机之间使用 winrm?将受信任的主机设置为 * 对我来说不是一个选项。

【问题讨论】:

    标签: windows windows-7 windows-server-2008 winrm remote-management


    【解决方案1】:

    如果两台机器在同一个域中,您应该能够使用 ComputerName 而不是 IP 地址。当您使用 IP 地址时,您几乎不得不使用我所看到的 TrustedHosts。

    【讨论】:

    • 抱歉耽搁了。这可能很有趣,但我在网络上的任何地方都找不到提到,如果您使用 ComputerName,则无需向 TrustedHosts 添加任何内容。但我证实它有效:)
    猜你喜欢
    • 2013-04-07
    • 2019-05-13
    • 1970-01-01
    • 1970-01-01
    • 2015-06-22
    • 2018-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多