# Ansible private key passphrase

**URL:** <https://forum.ansible.com/t/ansible-private-key-passphrase/36432>\
**Category:** Ansible Project\
**Created:** [March 14, 2022, 3:09am UTC](https://forum.ansible.com/t/ansible-private-key-passphrase/36432 "2022-03-14T03:09:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dip\_Giri](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@Dip\_Giri](https://forum.ansible.com/u/Dip_Giri)\
**Post date:** [March 14, 2022, 3:09am UTC](https://forum.ansible.com/t/ansible-private-key-passphrase/36432/1 "2022-03-14T03:09:06Z")

</div>

How to use private key passphrase in ansible inventory file

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [March 14, 2022, 1:16pm UTC](https://forum.ansible.com/t/ansible-private-key-passphrase/36432/2 "2022-03-14T13:16:29Z")

</div>

> How to use private key passphrase in ansible inventory file

What about using ssh agent on the controller machine and add that key with ssh-add?

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke

---

<div class="post-metadata">

**Author:** ![D111](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@D111](https://forum.ansible.com/u/D111)\
**Post date:** [March 14, 2022, 1:24pm UTC](https://forum.ansible.com/t/ansible-private-key-passphrase/36432/3 "2022-03-14T13:24:46Z")

</div>

[https://stackoverflow.com/questions/50277495/how-to-run-an-ansible-playbook-with-a-passphrase-protected-ssh-private-key](https://stackoverflow.com/questions/50277495/how-to-run-an-ansible-playbook-with-a-passphrase-protected-ssh-private-key)
