gpt4 book ai didi

ruby - ChefDK - WinRM 在提供域凭据时切换到基本身份验证。

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

我在 Windows 7 64 位上使用 ChefDK 0.3.5。我在尝试使用 Chef 和 WinRM 执行远程服务器上的 chef-client 命令。我发出的命令如下:

C:\U\user1> knife winrm "fqdn:testserver.*" "netstat" -x 'domain\user1' -P 'password'
WARNING: Switching to Negotiate authentication, Basic does not support Domain Authentication
ERROR: RuntimeError: Error: Unencrypted communication not supported. Please check winrm configuration winrm/config/service AllowUnencrypted flag.

我得到的结果不允许我做我想做的事。所以我用谷歌搜索了一下,看到了关于不验证 SSL 或使用 :verify_peer 的一些事情,它们什么也没做以及。所以我在 Command 中再次执行了 WinRM 配置命令提示,因为 PowerShell 告诉我他们错了。

C:\Users\user1>C:\WIndows\System32\cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 7200000
MaxConcurrentUsers = 10
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 25
MaxMemoryPerShellMB = 300
MaxShellsPerUser = 30


C:\Users\user1>C:\WIndows\System32\cmd.exe /c winrm set winrm/config @{MaxTimeoutms="1800000"}
Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 1800000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;G
XGW;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = true
Auth
Basic = false
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
AllowRemoteAccess = true
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 7200000
MaxConcurrentUsers = 10
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 25
MaxMemoryPerShellMB = 300
MaxShellsPerUser = 30


C:\Users\user1>C:\WIndows\System32\cmd.exe /c winrm set winrm/config/service@{AllowUnencrypted="true"}
Service
RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;
;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = true
Auth
Basic = false
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
AllowRemoteAccess = true

执行这些命令后,我再次尝试,ChefDK 看着我,就像我愚蠢的。我不确定为什么 Chef 要尝试使用基本身份验证然后我给它域凭据。这以前也有效,但我必须得到一个新的电脑和我的笔记,以及安装都丢失了。有什么想法吗我可能会错过什么?如果我遗漏了任何信息,请告诉我,我会更新我的问题。

最佳答案

客户端命令告诉你:

Unencrypted communication not supported. Please check winrm configuration winrm/config/service AllowUnencrypted flag.

根据 timeout 命令的结果打印出的配置告诉您:

Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 1800000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false

您需要通过运行以下命令将 AllowUnencrypted 标志设置为 true:

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

knife-windows 的最新 github 版本添加了用于创建 ssl 证书和加强连接的命令,希望您在准备就绪时希望这样做。

关于ruby - ChefDK - WinRM 在提供域凭据时切换到基本身份验证。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27748504/

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