# SSH Keys or Ask-pass opinion

**URL:** <https://forum.ansible.com/t/ssh-keys-or-ask-pass-opinion/12861>\
**Category:** Ansible Project\
**Created:** [May 23, 2013, 3:24pm UTC](https://forum.ansible.com/t/ssh-keys-or-ask-pass-opinion/12861 "2013-05-23T15:24:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Jelinek](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@James\_Jelinek](https://forum.ansible.com/u/James_Jelinek)\
**Post date:** [May 23, 2013, 3:24pm UTC](https://forum.ansible.com/t/ssh-keys-or-ask-pass-opinion/12861/1 "2013-05-23T15:24:58Z")

</div>

I currently have a set of VMs I'm testing Ansible on and use SSH keys to automate the authentication process. I'm admittedly a bit old-school and prefer using something like ask-sudo-pass and running the tasks as a sudo user. I just wanted to get an opinion on pros/cons of using Keys versus prompting for the pass?

What is everyone else doing? It seems to make sense to automate via keys, but I seem to fallback to prompting for a password.

-James

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [May 23, 2013, 3:27pm UTC](https://forum.ansible.com/t/ssh-keys-or-ask-pass-opinion/12861/2 "2013-05-23T15:27:00Z")

</div>

I use keys AND prompt for sudo password. My machines don’t allow password logins.

I’m also in the process of removing ‘shared’ users for logins.

---

<div class="post-metadata">

**Author:** ![James\_Jelinek](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@James\_Jelinek](https://forum.ansible.com/u/James_Jelinek)\
**Post date:** [May 23, 2013, 3:32pm UTC](https://forum.ansible.com/t/ssh-keys-or-ask-pass-opinion/12861/3 "2013-05-23T15:32:04Z")

</div>

That’s a solid strategy. I’m most likely going to disable password auth via ssh and stick to keys as well. But I think I’ll run everything as a sudo user and prompt for sudo password as you do.
