# Store ssh passphrase for another session.

**URL:** <https://forum.ansible.com/t/store-ssh-passphrase-for-another-session/30382>\
**Category:** Ansible Project\
**Created:** [May 21, 2019, 2:32pm UTC](https://forum.ansible.com/t/store-ssh-passphrase-for-another-session/30382 "2019-05-21T14:32:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veera](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/veera/32/4107_2.png) [@Veera](https://forum.ansible.com/u/Veera)\
**Post date:** [May 21, 2019, 2:32pm UTC](https://forum.ansible.com/t/store-ssh-passphrase-for-another-session/30382/1 "2019-05-21T14:32:59Z")

</div>

I have a set of ansible client servers accessible from ansible engine using ssh-key and passphrase.

When I run a ansible ad-hoc command , I have to enter passphase on each servers connections and this is repeating for all the tasks.

However from github search , find a way to reduce the enter the passphrase only one time by using the ssh-agent `"eval "$(ssh-agent -s)" ; ssh-add ~/.ssh/id_rsa" `and by entering passphrase once .

When I exit the shell and re-login the I have to re-run and enter the commands and passphrase again .

How can I avoid this ? Is there a way to store the passphrase as like in ansible-vault and use it for login?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [May 21, 2019, 2:39pm UTC](https://forum.ansible.com/t/store-ssh-passphrase-for-another-session/30382/2 "2019-05-21T14:39:36Z")

</div>

I would look into google on how to auto do ssh-add in your .vimrc file. I use oh my zsh and it auto adds it.
