# Kerberized SSH using a Keytab file

**URL:** <https://forum.ansible.com/t/kerberized-ssh-using-a-keytab-file/28645>\
**Category:** Ansible Project\
**Created:** [September 25, 2018, 3:36pm UTC](https://forum.ansible.com/t/kerberized-ssh-using-a-keytab-file/28645 "2018-09-25T15:36:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Horvath](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@Peter\_Horvath](https://forum.ansible.com/u/Peter_Horvath)\
**Post date:** [September 25, 2018, 3:36pm UTC](https://forum.ansible.com/t/kerberized-ssh-using-a-keytab-file/28645/1 "2018-09-25T15:36:56Z")

</div>

Hi All,

I have a setup where both the Ansible command machine itself and all the managed nodes are running Linux.  
They are part of Kerberos realm and I would like to use a directory user for Ansible SSH connections, authenticated from a Keytab file.

At the moment I have a solution where a cron job running on the command machine regularly performs a kinit on behalf of the account used by Ansible while I specify the following in the inventory file:

```auto
[all:vars]
# enable Kerberos ticket delegation for ssh and scp
ansible_ssh_extra_args=' -K '
ansible_scp_extra_args=' -o GSSAPIAuthentication=yes '

```

```auto

```

```auto
While this works, I am wondering if there is any better way of doing this. 

```

```auto

```

```auto

Is my understanding correct that there is no out-of-the-box support for Ansible to authenticate its SSH sessions from a Kerberos **keytab file**? 
Is there any best practice/convention/recommendation for such cases you could point me to?

Thanks,
Peter

```

---

<div class="post-metadata">

**Author:** ![Marek\_Ruzicka](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Marek\_Ruzicka](https://forum.ansible.com/u/Marek_Ruzicka)\
**Post date:** [October 2, 2018, 2:11pm UTC](https://forum.ansible.com/t/kerberized-ssh-using-a-keytab-file/28645/2 "2018-10-02T14:11:19Z")

</div>

Hi Peter,

I’m currently dealing with the same situation, so I’m as well very intersted in out of the box solution, or any suggestions.

Marek
