Назад | Перейти на главную страницу

WinRM с Kerberos: произошла неизвестная ошибка безопасности

Я пытаюсь настроить WinRM с помощью Kerberos, чтобы управлять серверами Windows с помощью Ansible.

У меня есть несколько серверов, которыми я хочу управлять, с разными версиями ОС.

Пара примеров серверов:

new.my.domain - Windows Server 2019 Datacenter
old.my.domain - Windows Server 2012 R2 Datacenter

При подключении к new.my.domain, все работает как положено. Но я не могу подключиться к old.my.domain. Я бежал winrm quickconfig -transport:https на обоих серверах и добавил правило брандмауэра для входящего трафика для порта 5986 на обоих.

Я получаю довольно плохие сообщения об ошибках, но мне удалось воспроизвести проблему, используя Test-WSMan в Powershell. Я запускаю следующие команды из old.my.domain:

Test-WSMan -ComputerName new.my.domain -Authentication Kerberos -UseSSL
[Output OK]

Test-WSMan -ComputerName old.my.domain -Authentication Negotiate -UseSSL
[Output OK]

Test-WSMan -ComputerName old.my.domain -Authentication Kerberos -UseSSL

Test-WSMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150858909" Machine="OLD.my.domain"><f:Message>WinRM cannot process the request. The following error with errorcode 0x8
0090322 occurred while using Kerberos authentication: An unknown security error occurred.
 Possible causes are:
  -The user name or password specified are invalid.
  -Kerberos is used when no authentication method and no user name are specified.
  -Kerberos accepts domain user names, but not local user names.
  -The Service Principal Name (SPN) for the remote computer name and port does not exist.
  -The client and remote computers are in different domains and there is no trust between the two domains.
 After checking for the above issues, try the following:
  -Check the Event Viewer for events related to authentication.
  -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or us
e HTTPS transport.
 Note that computers in the TrustedHosts list might not be authenticated.
   -For more information about WinRM configuration, run the following command: winrm help config. </f:Message></f:WSMan
Fault>
At line:1 char:1
+ Test-WSMan -ComputerName old.my.domain -Authentication Ke ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (old.my.domain:String) [Test-WSMan], InvalidOpe
   rationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

Когда я пытаюсь подключиться к локальной машине, я действительно не могу понять ни одной из возможных причин здесь. Что еще могло вызвать это? Я предполагаю, что это связано с Kerberos, так как Negotiate работает, есть ли указатели на то, где искать ошибки в настройке Kerberos?