# Best practice - Passwordless authentication or use --ask-pass before executing playbook?

**URL:** <https://forum.ansible.com/t/best-practice-passwordless-authentication-or-use-ask-pass-before-executing-playbook/28366>\
**Category:** Ansible Project\
**Created:** [August 20, 2018, 3:31pm UTC](https://forum.ansible.com/t/best-practice-passwordless-authentication-or-use-ask-pass-before-executing-playbook/28366 "2018-08-20T15:31:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amruth](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@amruth](https://forum.ansible.com/u/amruth)\
**Post date:** [August 20, 2018, 3:31pm UTC](https://forum.ansible.com/t/best-practice-passwordless-authentication-or-use-ask-pass-before-executing-playbook/28366/1 "2018-08-20T15:31:59Z")

</div>

Hi,

Can someone please say me the best practice of connecting to remote machines from Ansible hosted machine? Would it be a password less authentication by adding ssh-keys or use --ask-pass every time I execute the playbook?

Thanks

---

<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:** [August 20, 2018, 3:41pm UTC](https://forum.ansible.com/t/best-practice-passwordless-authentication-or-use-ask-pass-before-executing-playbook/28366/2 "2018-08-20T15:41:26Z")

</div>

ssh keys
