如何为 winrm 启用协商身份验证

如何为 winrm 启用协商身份验证

我已通过执行以下命令禁用服务器上 winrm 服务的协商身份验证:

winrm put winrm/config/service/Auth @{Negotiate="false"}

现在我可以使用 winrm 执行任何操作。我收到错误:

    Message = The WinRM client cannot process the request. The WinRM client trie
d to use Negotiate authentication mechanism, but the destination computer (local
host:47001) returned an 'access denied' error. Change the configuration to allow
 Negotiate authentication mechanism to be used or specify one of the authenticat
ion mechanisms supported by the server. To use Kerberos, specify the local compu
ter name as the remote destination. Also verify that the client computer and the
 destination computer are joined to a domain. To use Basic, specify the local co
mputer name as the remote destination, specify Basic authentication and provide
user name and password. Possible authentication mechanisms reported by server:

我理解这个错误,但问题是我在网上找到的启用协商身份验证的唯一方法是执行:

winrm put winrm/config/service/Auth @{Negotiate="true"}

这当然会导致上述错误。还有其他方法可以启用协商身份验证吗?

答案1

使用组策略:

计算机 > 策略 > 管理模板 > Windows 组件 > Windows 远程管理 > WinRM 服务:
不允许协商身份验证:已禁用。

答案2

编辑注册表项 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client。

将 auth_kerberos 和 auth_negotiate 设置为 1。

重新启动服务。

答案3

正如建议的那样这个答案,但服务,而不是客户端:

  1. 编辑注册表项HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Service

  2. 设置auth_kerberosauth_negotiate1

  3. 重新启动 Windows 远程管理 (WS-Management) 服务。

答案4

我有一台服务器可以工作,但另一台却不行。我找不到问题所在。最后我终于搞清楚了。

在发送服务器上:设置本地策略计算机配置\管理模板\系统\凭据委派\允许委派新凭据。在其中,在将服务器添加到列表中设置 WSMAN*(同时选中连接操作系统默认值的复选框)

在接收服务器上(使用以下内容创建 .reg 文件:):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Client] 
"auth_credssp"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Service]
"auth_credssp"=dword:00000001

对我有用

相关内容