gpt4 book ai didi

ansible - Ansible playbook 通过 HTTP 进行的 Kerberos 身份验证失败

转载 作者:行者123 更新时间:2023-12-03 09:13:11 25 4
gpt4 key购买 nike

我正在 Ansible 中构建一个 playbook,它将向多个 Windows 2012 R2 域 Controller (DC) 添加一些 DNS 条目。当尝试通过 HTTP 进行身份验证时,DC 拒绝我的凭据。

我已按照 Ansible 网站上的文档在我的控制计算机上配置 kerberos。

http://docs.ansible.com/ansible/intro_windows.html#active-directory-support

我还确认我可以使用我的凭据登录域:

$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: my-user@<REDACTED>

Valid starting Expires Service principal
10/06/2016 09:47:03 10/06/2016 19:47:03 krbtgt/<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
10/06/2016 09:47:48 10/06/2016 19:47:03 HTTP/phx-dev-mwad01.<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
10/06/2016 09:54:15 10/06/2016 19:47:03 HTTP/phx-dev-mwad02.<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59
10/06/2016 12:08:28 10/06/2016 19:47:03 HTTP/phx-dev-want01.<REDACTED>@<REDACTED>
renew until 10/07/2016 09:46:59

出于安全目的,我编辑了该域。

这是我的 winrm 配置文件:

ansible_user: my-user@<REDACTED>
ansible_password: SomePass
ansible_port: 5985
ansible_connection: winrm
# The following is necessary for Python 2.7.9+ when using default WinRM self-signed certificates:
ansible_winrm_server_cert_validation: ignore

我能够通过端口 5986 (HTTPS) 连接到 Windows 服务器,但是在生产中,域 Controller 未配置为 5986,因此 Ansible 必须 能够通过端口 5985 建立连接( HTTP)。此要求在生产中不会改变。

尝试通过 5985 连接时,我的凭据被拒绝;

fatal: [phx-dev-mwad02]: UNREACHABLE! => {"changed": false, "msg": "kerberos: (u'http', u'Bad HTTP response returned from server. Code 500'), plaintext: the specified credentials were rejected by the server", "unreachable": true}

WinRM 设置为允许远程管理:

$winrm quickconfig
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.

以下是我们的 WinRM 配置要点:

https://gist.github.com/anonymous/f2baaff517287c535453dbba4ef03b69

是的,我已经确认我的凭据是正确的。

最佳答案

查看 winrm 服务器配置中的 AllowUnencrypted = false。目前看来 python winrm 不支持 message encryption without https 。作为解决方法,您可以将其设置为 true,这是不安全,因此我强烈不建议这样做(cmd):

winrm set winrm/config/service @{AllowUnencrypted="true"}

请参阅 https://pypi.python.org/pypi/pywinrmHTTP 或 HTTPS 端点 部分

关于ansible - Ansible playbook 通过 HTTP 进行的 Kerberos 身份验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39905667/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com