# Connect to windows machine with Kerberos

**URL:** <https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [May 4, 2023, 5:09pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964 "2023-05-04T17:09:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [May 4, 2023, 5:09pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/1 "2023-05-04T17:09:41Z")

</div>

I am using kerberos to connect to windows hosts to run playbook, for this I have to kinit username and password everyday if not I need to specify the password on the inventory file which is not great idea. So some one please suggest me how can I save the password details.  
Thanks in advance…

---

<div class="post-metadata">

**Author:** ![area51coder](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@area51coder](https://forum.ansible.com/u/area51coder)\
**Post date:** [May 5, 2023, 7:24am UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/2 "2023-05-05T07:24:42Z")

</div>

Hello Narmada,

I assume you have DC in your enviroment. you have to follow steps as mentioned in below link to establise permanent kerberos authentication.  
please check.

[http://yoursmartbook.blogspot.com/2021/06/to-enable-kerberos-authentication-for.html](http://yoursmartbook.blogspot.com/2021/06/to-enable-kerberos-authentication-for.html)

Ravi.

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [May 5, 2023, 5:26pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/3 "2023-05-05T17:26:38Z")

</div>

I have done all these I am able to run playbooks on windows machines using kerberos. I did kinit [username@DOMAIN.COM](mailto:username@DOMAIN.COM), but I need to do this everyday. so followed the docs and implemented ansible-vault which is also working. Using ansible-vault I have to save the password for the enctyption/decryption some where on the server. So my question now is is there anyway ansible decrypts the password while executing the playbook.

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [May 5, 2023, 8:45pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/4 "2023-05-05T20:45:19Z")

</div>

What is your question exactly?

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [May 5, 2023, 9:46pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/5 "2023-05-05T21:46:05Z")

</div>

sure I will get back to this again, but I see this error all of a sudden  
kerberos: the python kerberos library is not installed  
I have all necessary components installed

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [May 5, 2023, 9:52pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/6 "2023-05-05T21:52:24Z")

</div>

pip list |grep -i kerb  
pykerberos 1.2.4  
requests-kerberos 0.14.0

---

<div class="post-metadata">

**Author:** ![Narmada\_Karthika](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@Narmada\_Karthika](https://forum.ansible.com/u/Narmada_Karthika)\
**Post date:** [May 5, 2023, 10:23pm UTC](https://forum.ansible.com/t/connect-to-windows-machine-with-kerberos/37964/7 "2023-05-05T22:23:36Z")

</div>

also I followed one of your previous docs, I see  
[teamci-deploy-user@server01 win]$ echo $ANSIBLE\_PYTHON  
/usr/bin/python2  
how can I change this to python 3
