Hello,
I have an issue with connecting to windows host using Kerberos authentication mechanism with winrm over HTTP scheme,
As our windows host have this set to true, Set-Item -Path WSMan:\localhost\Service\AllowUnencrypted -Value $true
I get this error message “msg”: “kerberos: the specified credentials were rejected by the server”,
But when I set that to false on the windows host winrm config Set-Item -Path WSMan:\localhost\Service\AllowUnencrypted -Value $false it works fine,
We Don’t want it to be unencrypted,
As the session is not being received on the windows host as encrypted,
and it is rejecting the credentials passed,
this is the config I have on my playbook,
-
hosts: all
gather_facts: false
vars:
ansible_user: username
ansible_winrm_port: 5985
ansible_winrm_kinit_mode: managed
ansible_connection: winrm
ansible_winrm_realm:
ansible_winrm_transport: kerberos
ansible_winrm_kinit_cmd: /usr/share/centrifydc/kerberos/bin/kinit
ansible_winrm_scheme: http
ansible_winrm_message_encryption: always
tasks: -
win_ping:
Output:
Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/windows/win_ping.ps1
Pipelining is enabled.
<postest19.fastenal.com> ESTABLISH WINRM CONNECTION FOR USER: xyz@DOMAIN.COM on PORT 5985 TO postest19.fastenal.com
fatal: [abc.domain.com]: UNREACHABLE! => {
“changed”: false,
“msg”: “kerberos: the specified credentials were rejected by the server”,
“unreachable”: true
}
Any help would be appreciated!!