[英]How can I change the Authentication method in connections between WinRm and Terraform with hyperv provider?
我正在嘗試使用 hyperv 提供程序創建一些虛擬機,但我需要為 HyperV API 定義一些參數。問題是 WinRm(即嘗試與主機連接的工具)無法訪問我的使用基本身份驗證的憑據。 但是,如果我使用 Negotiate Auth,它會返回一個成功的連接。 所以,我不知道如何在 Terraform 中為此定義一個參數。 這是我在 Terraform 中的提供商配置代碼:
provider "hyperv" {
user = myusername
password = mypassword
host = myhost
port = 5985
https = false
insecure = true
timeout = "60s"
}
我的 winrm/配置/客戶端:
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = true
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = true
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts = *
我的 winrm/配置/服務:
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 240000
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = true
Auth
Basic = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = true
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = true
EnableCompatibilityHttpsListener = true
CertificateThumbprint
AllowRemoteAccess = true
嗨,伙計們。 如果有人有同樣的問題,我會這樣解決:
-我從本地用戶激活管理員用戶。
- 然后,必須在 CMD 中運行此命令:
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
-重啟系統
-然后,在CMD中運行winrm quickconfig
quickconfig,就可以了。
我希望它能幫助你!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.