# Server not found in Kerberos Database

**URL:** <https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 1, 2016, 10:40pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638 "2016-06-01T22:40:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [June 1, 2016, 10:40pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/1 "2016-06-01T22:40:48Z")

</div>

Control Node:

- CentOS 7

- Ansible 2.1

- pywinrm version from May 19th, 2016

Remote Node:

- Windows 7

- Powershell 3

I’m having trouble connecting to my remote node with kerberos. I have carefully followed all the instructions from the [Ansible Docs website](http://docs.ansible.com/ansible/intro_windows.html#active-directory-support). When I run “klist” it shows a kerberos-ticket-getting-ticket so I know it is working that far. But then when I run win\_ping, I get the error message below. Can I assume all AD accounts are in the Kerberos Database or do they need to be added somehow? Otherwise how can I fix this?

**$ cat windows.yml**

---

<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:** [June 2, 2016, 6:37pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/2 "2016-06-02T18:37:24Z")

</div>

Is both your user and your computer named “ADS-6999”?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [June 2, 2016, 6:56pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/3 "2016-06-02T18:56:54Z")

</div>

Yes, they are the same. Is that a problem? I could make a new account local or domain.

---

<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:** [June 7, 2016, 10:57am UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/4 "2016-06-07T10:57:58Z")

</div>

Probably not. First, make sure you specify ansible\_user: ads-6999 including the realm, so ansible\_user: [ads-6999@acme.com](mailto:ads-6999@acme.com). Not sure if that has any effect, but still. If that fails, I’d create a new user with a different name from the node to see if that helps.

---

<div class="post-metadata">

**Author:** ![Alf\_Normann\_Klausen](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@Alf\_Normann\_Klausen](https://forum.ansible.com/u/Alf_Normann_Klausen)\
**Post date:** [October 20, 2016, 11:17am UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/5 "2016-10-20T11:17:50Z")

</div>

Hi,

I think I have the exact same problem.  
Running ansible 2.1.1.0-1.el7 on CentOS 7.2.1511

Here is an example of ansible command output:

`

[alfkla@webdmz.no@tvm-alfkla ~]$ ansible -i hosts TVM-ALF2012R2 -m win\_ping -vvvvv  
Using /etc/ansible/ansible.cfg as config file  
Loaded callback minimal of type stdout, v2.0  
\<192.168.4.225\> ESTABLISH WINRM CONNECTION FOR USER: alfkla@WEBDMZ.NO on PORT 5985 TO 192.168.4.225  
\<192.168.4.225\> WINRM CONNECT: transport=kerberos endpoint=[http://192.168.4.225:5985/wsman](http://192.168.4.225:5985/wsman)  
\<192.168.4.225\>  
WINRM CONNECTION ERROR: authGSSClientStep() failed: ((‘Unspecified GSS  
failure. Minor code may provide more information’, 851968), (‘Server  
not found in Kerberos database’, -1765328377))  
Traceback (most recent call last):  
File “/usr/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py”, line 151, in _winrm\_connect  
self.shell\_id = protocol.open\_shell(codepage=65001) # UTF-8  
File “/usr/lib/python2.7/site-packages/winrm/protocol.py”, line 132, in open\_shell  
res = self.send\_message(xmltodict.unparse(req))  
File “/usr/lib/python2.7/site-packages/winrm/protocol.py”, line 207, in send\_message  
return self.transport.send\_message(message)  
File “/usr/lib/python2.7/site-packages/winrm/transport.py”, line 170, in send\_message  
prepared\_request = self.session.prepare\_request(request)  
File “/usr/lib/python2.7/site-packages/requests/sessions.py”, line 394, in prepare\_request  
hooks=merge\_hooks(request.hooks, self.hooks),  
File “/usr/lib/python2.7/site-packages/requests/models.py”, line 298, in prepare  
self.prepare\_auth(auth, url)  
File “/usr/lib/python2.7/site-packages/requests/models.py”, line 500, in prepare\_auth  
r = auth(self)  
File "/usr/lib/python2.7/site-packages/requests\_kerberos/kerberos_.py", line 318, in **call**  
auth\_header = self.generate\_request\_header(None, host, is\_preemptive=True)  
File “/usr/lib/python2.7/site-packages/requests\_kerberos/kerberos\_.py”, line 158, in generate\_request\_header  
raise KerberosExchangeError(“%s failed: %s” % (kerb\_stage, str(error.args)))  
KerberosExchangeError:  
authGSSClientStep() failed: ((‘Unspecified GSS failure. Minor code may  
provide more information’, 851968), (‘Server not found in Kerberos  
database’, -1765328377))

TVM-ALF2012R2 | UNREACHABLE! =\> {  
“changed”: false,

“msg”: “kerberos: authGSSClientStep() failed: ((‘Unspecified GSS  
failure. Minor code may provide more information’, 851968), (‘Server  
not found in Kerberos database’, -1765328377))”,  
“unreachable”: true  
}  
`

The kerberos ticket is ok:

`  
[alfkla@webdmz.no@tvm-alfkla ~]$ klist  
Ticket cache: KEYRING:persistent:1015602603:1015602603  
Default principal: alfkla@WEBDMZ.NO

Valid starting Expires Service principal  
20. okt. 2016 13:06 20. okt. 2016 23:06 krbtgt/WEBDMZ.NO@WEBDMZ.NO  
renew until 27. okt. 2016 13:06

`

The inventory is like this:

`  
[alfkla@webdmz.no@tvm-alfkla ~]$ grep ^TVM-ALF2012R2 hosts

TVM-ALF2012R2 ansible\_host=192.168.4.225 ansible\_user=alfkla@WEBDMZ.NO  
ansible\_password=xXxXxXxXx ansible\_port=5985 ansible\_connection=winrm  
ansible\_winrm\_transport=kerberos ansible\_winrm\_kerberos\_delegation=yes  
`

Any clue why this happens?

All help will be highly appreciated! :o)

Vennlig hilsen,

Alf Normann Klausen

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [October 20, 2016, 5:13pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/6 "2016-10-20T17:13:17Z")

</div>

Kerberos is highly dependent on DNS and name-\>realm mapping; you need to use the host’s FQDN, not its IP, unless you’ve hacked up your krb5.conf and DNS infra significantly to support that.

---

<div class="post-metadata">

**Author:** ![Alf\_Normann\_Klausen](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@Alf\_Normann\_Klausen](https://forum.ansible.com/u/Alf_Normann_Klausen)\
**Post date:** [October 20, 2016, 5:32pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/7 "2016-10-20T17:32:32Z")

</div>

> > **_Kerberos is highly dependent on DNS and name-\>realm mapping; you need to use the host’s FQDN, not its IP, unless you’ve hacked up your krb5.conf and DNS infra significantly to support that._**

Wow, I replaced the ip address in variable ansible\_host= with the FQDN:

`[alfkla@webdmz.no@tvm-alfkla ~]$ grep ^TVM-ALF2012R2 hosts TVM-ALF2012R2 ansible_host=TVM-ALF2012R2.WEBDMZ.NO ansible_user=alfkla@WEBDMZ.NO ansible_password=xXxXxXx ansible_port=5985 ansible_connection=winrm ansible_winrm_transport=kerberos ansible_winrm_kerberos_delegation=yes [alfkla@webdmz.no@tvm-alfkla ~]$`

And now it works!

`[alfkla@webdmz.no@tvm-alfkla ~]$ ansible -i hosts TVM-ALF2012R2 -m win_ping TVM-ALF2012R2 | SUCCESS => { "changed": false, "ping": "pong" } [alfkla@webdmz.no@tvm-alfkla ~]$`

Thanks a million Matt Davis!!! :o)

Kind regards,  
Alf Norman Klausen

---

<div class="post-metadata">

**Author:** ![Krishan\_Kant](https://avatars.discourse-cdn.com/v4/letter/k/e47774/32.png) [@Krishan\_Kant](https://forum.ansible.com/u/Krishan_Kant)\
**Post date:** [December 2, 2016, 7:53am UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/8 "2016-12-02T07:53:34Z")

</div>

Hi skinnedknuckles,

Does it work for you now? I am getting the same error message.

Server\_Name | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “kerberos: ((‘Unspecified GSS failure. Minor code may provide more information’, 851968), (‘Server not found in Kerberos database’, -1765328377))”,  
“unreachable”: true  
}

-Krishan

---

<div class="post-metadata">

**Author:** ![Jonathan\_Anderson](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Jonathan\_Anderson](https://forum.ansible.com/u/Jonathan_Anderson)\
**Post date:** [December 2, 2016, 5:18pm UTC](https://forum.ansible.com/t/server-not-found-in-kerberos-database/21638/9 "2016-12-02T17:18:58Z")

</div>

I never got Kerberos to work. I ended up using SSL instead.
