# Understanding relationship between -K & become vs ansible\_ssh\_user & ansible\_ssh\_pass

**URL:** <https://forum.ansible.com/t/understanding-relationship-between-k-become-vs-ansible-ssh-user-ansible-ssh-pass/35713>\
**Category:** Ansible Project\
**Created:** [September 8, 2021, 1:10am UTC](https://forum.ansible.com/t/understanding-relationship-between-k-become-vs-ansible-ssh-user-ansible-ssh-pass/35713 "2021-09-08T01:10:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michelle\_Dupuis](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Michelle\_Dupuis](https://forum.ansible.com/u/Michelle_Dupuis)\
**Post date:** [September 8, 2021, 1:10am UTC](https://forum.ansible.com/t/understanding-relationship-between-k-become-vs-ansible-ssh-user-ansible-ssh-pass/35713/1 "2021-09-08T01:10:57Z")

</div>

I am creating a simple playbook to add the current user’s public key onto the remote host. My playbook fails with error “Failed to connect to the host via ssh: Permission denied”.

I am running the playbook as non-root, and I can succesfully ssh to the remote host as root. I run the following script with -K and enter the become password when prompted.

---

<div class="post-metadata">

**Author:** ![steve\_missoh](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@steve\_missoh](https://forum.ansible.com/u/steve_missoh)\
**Post date:** [September 19, 2021, 12:32am UTC](https://forum.ansible.com/t/understanding-relationship-between-k-become-vs-ansible-ssh-user-ansible-ssh-pass/35713/2 "2021-09-19T00:32:12Z")

</div>

Hi,

1. You are correct but to be more precise, -K is the become password while -k is the user password
2. You are correct; just to add that become is a privilege escalation, meaning you still connect as X and then sudo as root on the managed node
3. ansible\_user and ansible\_password will peer with -k, not -K

- That None user is strange, is that an actual user ? I suggest you specify remote\_user = [user you log with on the remote system]
