# Kerberos domain authentication for Windows hosts

**URL:** <https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205>\
**Category:** Ansible Developer\
**Tags:** windows, awx\
**Created:** [September 12, 2014, 10:47pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205 "2014-09-12T22:47:12Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 30, 2014, 5:16pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/21 "2014-10-30T17:16:26Z")

</div>

Chris Church has domain auth basically functional at this point - stay tuned for some updates, that possibly require some contributions not yet in winrm upstream…

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [October 30, 2014, 11:30pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/22 "2014-10-30T23:30:12Z")

</div>

Thanks, this is great news. For what its worth using my plugin, I noticed a couple of intermittent failures today when running against more than a few hosts. I assume this is because I haven’t implemented any synchronization around the calls to kinit.  
So I look forward to Chris’ implementation. Happy to test when something is available.

Jon

---

<div class="post-metadata">

**Author:** ![jiuxiang\_chen](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jiuxiang\_chen](https://forum.ansible.com/u/jiuxiang_chen)\
**Post date:** [December 26, 2014, 12:21pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/23 "2014-12-26T12:21:25Z")

</div>

Hi,

Has the function of Domain authentication for Windows been implemented?  
I need to connect to Windows host with a domain user, how can I implement it?

Thanks,  
Jiuxiang

在 2014年10月30日星期四UTC-4下午7时30分12秒，jhawkesworth写道：

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [December 27, 2014, 5:57am UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/24 "2014-12-27T05:57:36Z")

</div>

>

---

<div class="post-metadata">

**Author:** ![jiuxiang\_chen](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jiuxiang\_chen](https://forum.ansible.com/u/jiuxiang_chen)\
**Post date:** [January 4, 2015, 3:13am UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/25 "2015-01-04T03:13:04Z")

</div>

Hi,

I’m just a user of Ansible, now I have a requirement of using Domain authentication for Windows, so I want to to know how can use this function.  
Please let me know how to use it when you implement it, thanks,.  
I also pay attention to this topic.

Thanks.

在 2014年12月27日星期六UTC-5上午12时57分57秒，Chris Church写道：

---

<div class="post-metadata">

**Author:** ![Gregory\_Seroka](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@Gregory\_Seroka](https://forum.ansible.com/u/Gregory_Seroka)\
**Post date:** [January 30, 2015, 8:05pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/26 "2015-01-30T20:05:21Z")

</div>

I set up the build described above using NTLM authentication (DOMAIN\user).

I run “whoami” register the variable and then run debug on the variable to confirm I am logged in as a domain user using NTLM credentials. When I try to run a long running process such as “[setup.com](http://setup.com) /PrepareSchema” (this is the unattended setup command for installing Microsoft exchange) the playbook errors out with:

> failed to exec cmd D:\setup.com /PrepareSchema

The last line in the callback is:

> ReadTimeout: HTTPSConnectionPool (host=‘x.x.x.x’, port =5986): Read timed out. (read timeout=10)

Shorter running processes will complete just fine.

Using a standard Ansible build and running the same command on the host can be completed using psexec and local credentials, but this complicates the playbook and I would prefer to use the correct credentials for the job.

Has anyone seen this or made it work in their environments?

---

<div class="post-metadata">

**Author:** ![David\_Goade](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@David\_Goade](https://forum.ansible.com/u/David_Goade)\
**Post date:** [February 20, 2015, 3:09pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/27 "2015-02-20T15:09:16Z")

</div>

Chris,

Thanks so much for your work on this. I’m working on a project to automate Windows updates for our application and since domain auth was a must-have requirement, it wasn’t looking good for Ansible as the orchestrator – until I found this thread and tried-out you branches. Now, domain auth over kerberos is working just fine and we’re sticking with Ansible. TGT management with kinit is not a problem at all for me. I just added a local task to my playbook to get kinit to request the TGT using an encrypted keytab file and everything is automated.

-David

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [February 20, 2015, 8:19pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/28 "2015-02-20T20:19:24Z")

</div>

If you’re using Kerberos you’re probably running into double-hop authentication issues. Kerberos doesn’t support double-hops. As your Exchange server tries to execute a schema update against a Domain Controller I wouldnt be surprised if this is what’s causing it.

---

<div class="post-metadata">

**Author:** ![Gregory\_Seroka](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@Gregory\_Seroka](https://forum.ansible.com/u/Gregory_Seroka)\
**Post date:** [February 23, 2015, 4:25pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/29 "2015-02-23T16:25:00Z")

</div>

I’m not using Kerberos, just NTLM if that makes a difference.

-Greg

---

<div class="post-metadata">

**Author:** ![David\_Goade](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@David\_Goade](https://forum.ansible.com/u/David_Goade)\
**Post date:** [March 19, 2015, 2:34pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/30 "2015-03-19T14:34:03Z")

</div>

Hey Chris,

I noticed [this mention of kerberos support in the stable-1.9 branch](https://github.com/ansible/ansible/blob/stable-1.9/docsite/rst/intro_windows.rst#installing-on-the-control-machine) but after spot-comparing some of the code there with your [winrm\_kerberos\_support](https://github.com/cchurch/ansible/tree/winrm_kerberos_support) branch, it doesn’t look like stable-1.9 has all of the changes you added for Kerberos yet. I’ve been using your fork for my project (which requires Kerberos domain auth) and it mostly works but I’m still getting some timeouts on win2008r2 so I was wondering if it would be worthwhile to give stable-1.9 a try yet. Do you have a suggestion?

-David

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 19, 2015, 2:35pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/31 "2015-03-19T14:35:18Z")

</div>

please do and report any issues you see, the reason for the release  
candidate it to catch bugs like this one.

---

<div class="post-metadata">

**Author:** ![David\_Goade](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@David\_Goade](https://forum.ansible.com/u/David_Goade)\
**Post date:** [March 19, 2015, 6:39pm UTC](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205/32 "2015-03-19T18:39:45Z")

</div>

Brian,

I tried using keberos on the stable-1.9 branch and it failed immediately with:

fatal: [updateMe1] =\> Traceback (most recent call last):  
File “/home/ansible/ansible/lib/ansible/runner/ **init**.py”, line 582, in \_executor  
exec\_rc = self.\_executor\_internal(host, new\_stdin)  
File “/home/ansible/ansible/lib/ansible/runner/ **init**.py”, line 785, in \_executor\_internal  
return self.\_executor\_internal\_inner(host, self.module\_name, self.module\_args, inject, port, complex\_args=complex\_args)  
File “/home/ansible/ansible/lib/ansible/runner/ **init**.py”, line 960, in \_executor\_internal\_inner  
conn = self.connector.connect(actual\_host, actual\_port, actual\_user, actual\_pass, actual\_transport, actual\_private\_key\_file, delegate\_host)  
File “/home/ansible/ansible/lib/ansible/runner/connection.py”, line 52, in connect  
self.active = conn.connect()  
File “/home/ansible/ansible/lib/ansible/runner/connection\_plugins/winrm.py”, line 147, in connect  
self.protocol = self.\_winrm\_connect()  
File “/home/ansible/ansible/lib/ansible/runner/connection\_plugins/winrm.py”, line 87, in \_winrm\_connect  
cache\_key = ‘%s:%s@%s:%d’ % (self.user, hashlib.md5(self.password).hexdigest(), self.host, port)  
TypeError: must be string or buffer, not None

[Previous page](https://forum.ansible.com/t/kerberos-domain-authentication-for-windows-hosts/16205.md?page=1)
