Winrm не удается обработать запрос при проверке подлинности kerberos возникла следующая ошибка

  • Remove From My Forums
  • Вопрос

  • Доброго времени суток. Получаю данное сообщение, когда пытаюсь удаленно выполнить команду, типа icm -computername pc1 -scriptblock {Test-Path c:windows} и получаю это:

    [pc1] Сбой подключения к удаленному серверу pc1. Сообщение об ошибке: WinRM не удается обработать запрос. П
    ри использовании проверки подлинности Kerberos возникла следующая ошибка с кодом ошибки 0x80090322: Произошла неизвестн
    ая ошибка безопасности.
     Возможные причины:
      — Указаны неверные имя пользователя или пароль.
      — Используется проверка подлинности Kerberos без указания способа проверки подлинности и имени пользователя.
      — Kerberos принимает имена пользователей домена, но не принимает имена локальных пользователей.
      — Имя субъекта-службы (SPN) для имени и порта удаленного компьютера не существует.
      — Клиентский и удаленный компьютеры находятся в разных доменах, между которыми отсутствует доверительное отношение.
     После проверки указанных выше проблем попробуйте выполнить следующее:
      — Просмотрите в средстве «Просмотр событий» события, относящиеся к проверке подлинности.
      — Измените способ проверки подлинности, добавьте конечный компьютер в конфигурацию TrustedHosts для WinRM либо воспол
    ьзуйтесь транспортом HTTPS.
     Помните о том, что компьютеры в списке TrustedHosts могут не проходить проверку подлинности.
       — Для получения дополнительных сведений о конфигурации WinRM выполните следующую команду: winrm help config. Подробн
    ости см. в разделе справки «about_Remote_Troubleshooting».
        + CategoryInfo          : OpenError: (pc1:String) [], PSRemotingTransportException
        + FullyQualifiedErrorId : -2144108387,PSSessionStateBroken

    ОС ХР, локально и удаленно на 5985 заходит нормально. На комп захожу с правами админа. А вот icm и new-psession, тоже локально и удаленно, нет. Хотелось бы узнать что это ошибка значит и как ее решить? Вывод setspn -L pc1:

    Зарегистрирован ServicePrincipalNames для CN=pc1,DC=com:
            HTTP/pc1.com
            HTTP/pc.1
            WSMAN/pc1
            WSMAN/pc1.com
            HOST/pc1
            HOST/pc1.com
    По IP адресу отрабатывает норм, т.е. dir \10.1.1.1c$ выполняется нормально.

    • Изменено

      8 июня 2015 г. 7:39

Ответы

  • Весьма подозрительное сообщение. Проверьте — с помощью ping, nslookup, nbtstat -a/nbtstat -c (если NetBIOS включен) — не разрешается ли имя PC1 случайно в адрес для PC2?


    Слава России!

    • Помечено в качестве ответа
      Net Ranger
      9 июня 2015 г. 5:37

I have two forests with a transitive on-way trust between them: PROD -> TEST (test trusts PROD). I had previously had kerberos authentication working with winrm from PROD to machines in TEST. I have verified the trust is healthy, I also verified users
in TEST can use WINRM with kerberos just fine. Users from PROD cannot connect via kerberos to machines in TEST with winrm.

I have verified the service has registered the appropriate SPNs. I ran dcdiag against all my PROD and TEST domain controllers and didn’t find anything that would prevent kerberos from happening. I even tried disabling the firewall entirely on my TEST dcs
but that didn’t gain me anything.

I’ve enabled kerberos logging but only see the expected errors such as it couldn’t find a PROD SPN for the machine, which it shouldn’t from what I understand, it should go to the TEST domain and find the SPN from there.

I’m really out of next steps before I call PSS and hope someone here has run into this and could provide me some next steps.

PowerShell Error:

Connecting to remote server failed with the following error message : WinRM cannot process the request. The following error occured while using Kerberos authentication: The network path was not found.  
 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 use 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. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (:) [], PSRemotingTransportException
    + FullyQualifiedErrorId : PSSessionStateBroken

winrs Error:

Winrs error:
WinRM cannot process the request. The following error occured while using Kerberos authentication: The network path was not found.  
 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 use 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.

При настройке WinRM на серверах в домене Active Directory столкнулся со странной проблемой. После того как служба WinRM была настроена и включена на сервере, к ней разрешено удалённое подключение через Windows PowerShell Remoting, при попытке удаленного подключения к данному серверу с помощью команды
Enter-PSSession msk-dp01
в консоли PowerShell появляется следующая ошибка WinRM:

Enter-PSSession : Сбой подключения к удаленному серверу msk-dp01. Сообщение об ошибке: Клиенту WinRM не удается обработать запрос. Невозможно определить тип содержимого ответа HTTP от компьютера назначения. Тип содержимого не является допустимым или отсутствует. Подробности см. в разделе справки «about_Remote_Troubleshooting».

строка:1 знак:1

+ Enter-PSSession msk-dp01

+ ~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidArgument: (msk-dp01:String) [Enter-PSSession], PSRemotingTransportException

+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Enter-PSSession : Сбой подключения к удаленному серверу msk-dp01. Сообщение об ошибке: Клиенту WinRM не удается обработать запрос. Невозможно определить тип содержимого ответа HTTP от компьютера назначения. Тип содержимого не является допустимым или отсутствует.

В английской версии Windows ошибка выглядит так:

PS C:Windowssystem32> Enter-PSSession msk-dp01

Enter-PSSession : Connecting to remote server msk-dp01 failed with the following error message : The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure. For more information, see the about_Remote_Troubleshooting Help topic.

At line:1 char:1

+ Enter-PSSession msk-dp01

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : InvalidArgument: (msk-dp01:String) [Enter-PSSession], PSRemotingTransportException

+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed

The WinRM client received an HTTP bad request status (400),

При этом на сервере порты WinRm (5985/HTTP, 5986/HTTPS) отвечают и принимают соединения. Проверить доступность TCP портов WinRM можно с помощью утилиты PortQryV2 или командлета PowerShell Test-NetConnection:

TNC msk-dp01 –port 5985

Test-NetConnection WinRm (5985/HTTP, 5986/HTTPS)

Как оказалось, проблема оказалась связана с большим размером токена Kerberos у пользователя, за счет того, что пользователь состоит в слишком большом количестве доменных групп. Ошибка возникает при превышении размера токена 16 Кб (см статью MaxTokenSize — размер токена Kerberos). В нашей ситуации происходит все тоже самое, сервер WinRm сбрасывает запрос от клиента, т.к. размер заголовка пакета аутентификации превышает 16 Кб. В статье по ссылке мы упоминали, что по-умолчанию в IIS используется размер HTTP заголовка не более 16 Кб, и в случае проблем с HTTP аутентификацией из за большого токена пользователя, его нужно увеличить до 64 Кб

Чтобы исправить проблему, нужно уменьшить размер токена (уменьшить количество групп безопасности, в которых состоит пользователь), а если это невозможно, тогда в редакторе реестра на сервере нужно изменить значение следующих DWORD параметров реестра в ветке HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesHTTPParameters

  • MaxFieldLength увеличить до 0000ffff (65535)
  • MaxRequestBytes увеличить до 0000ffff (65535)

HTTP MaxRequestBytes

Осталось перезагрузить сервер и проверить подключение WinRm через Enter-PSSession с клиента.

The issue

When connecting to a standalone computer with a PowerShell PSSession you get the following error:

WinRM cannot process the request.
The following error with errorcode 0x80090311 occurred while using Kerberos authentication:
We can't sign you in with this credential because your domain isn't available.
Make sure your device is connected to your organization's network and try again.

The explanation

PowerShell tries to connect with Kerberos, but Kerberos is only available for domain members.
At the same time, you have disabled all other authentication methods, either on the client computer or on the target computer.

How to solve your problem

  1. Check available authentication methods on the client computer
    Get-ChildItem -Path WSMan:localhostClientAuth
    
  2. Check available authentication methods on the target computer
    Get-ChildItem -Path WSMan:localhostServiceAuth
    
  3. Ensure you have a common authentication method
  4. Specify this method in the authentication parameter of the command line
    Enter-PSSession -ComputerName MyComputer -Authentication Credssp -Credential $Cred
    

PS C:Windowssystem32> Enter-PSSession -ComputerName serv1

Enter-PSSession : Сбой подключения к удаленному серверу serv1. Сообщение об ошибке: Клиенту WinRM не удается обработать запрос. Если применяемая схема проверки подлинности отличается от Kerberos или компьютер клиента не входит в домен, необходимо использовать транспорт HTTPS или добавить компьютер назначения к значениям параметра конфигурации TrustedHosts. Чтобы настроить TrustedHosts, используйте winrm.cmd. Обратите внимание, что в списке TrustedHosts могут находиться компьютеры, не прошедшие проверку подлинности. Чтобы получить дополнительные сведения об этом, выполните следующую команду: winrm help config. Подробности см. в разделе справки «about_Remote_Troubleshooting».

строка:1 знак:1

+ Enter-PSSession -ComputerName serv1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (serv1:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Возможно, вам также будет интересно:

  • Winrik ошибка excel application import module
  • Winrarsfx ошибка файл защищен паролем
  • Winrar ошибка при извлечении
  • Winrar ошибка не удается найти указанный файл
  • Winrar ошибка контрольной суммы файл поврежден как исправить

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии