# Understanding Ansible remote user

**URL:** <https://forum.ansible.com/t/understanding-ansible-remote-user/31430>\
**Category:** Ansible Project\
**Created:** [October 7, 2019, 4:00pm UTC](https://forum.ansible.com/t/understanding-ansible-remote-user/31430 "2019-10-07T16:00:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vicente\_Dominguez](https://avatars.discourse-cdn.com/v4/letter/v/bbe5ce/32.png) [@Vicente\_Dominguez](https://forum.ansible.com/u/Vicente_Dominguez)\
**Post date:** [October 7, 2019, 4:00pm UTC](https://forum.ansible.com/t/understanding-ansible-remote-user/31430/1 "2019-10-07T16:00:51Z")

</div>

I am sure that this is probably a silly question, but It’s the basis for the preparation for Ansible certification exam. I have troubles with the understanding of the Ansible remote\_user.

Let’s imagine that you have a control node and a managed host to perform some action, the users in both nodes are as follows:

Control node → ROOT, User1 , User2, User3

Managed Host → ROOT, User3

So, if you are logged as ROOT in the control node, and you execute a playbook to perform some action in the managed host, and you use the key words REMOTE\_USER = User3, are you using your control’s node User3 to perform the action within the managed host? OR are you loginng as managed host’s User3 to perform the action?

Hope you can help me… as I was not able to find anything clear in the documentation.

Thank you in advance!!!

---

<div class="post-metadata">

**Author:** ![vbotka](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/vbotka/32/359_2.png) [@vbotka](https://forum.ansible.com/u/vbotka)\
**Post date:** [October 7, 2019, 4:27pm UTC](https://forum.ansible.com/t/understanding-ansible-remote-user/31430/2 "2019-10-07T16:27:24Z")

</div>

'remote\_user' is 'loginng as managed host's User3'

See  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_intro.html#intro-to-playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#intro-to-playbooks)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 7, 2019, 4:30pm UTC](https://forum.ansible.com/t/understanding-ansible-remote-user/31430/3 "2019-10-07T16:30:25Z")

</div>

Ansible will login to the managed host user3. It will do

ssh User3@managed-host /some/random/ansible/path/to/a/ansible/python/script

To see what ansible is actullay doing you can add -vvv to the ansible and ansible-playbook and you will get a more detail output of all the ssh commands ansible is running.

---

<div class="post-metadata">

**Author:** ![Vicente\_Dominguez](https://avatars.discourse-cdn.com/v4/letter/v/bbe5ce/32.png) [@Vicente\_Dominguez](https://forum.ansible.com/u/Vicente_Dominguez)\
**Post date:** [October 7, 2019, 5:02pm UTC](https://forum.ansible.com/t/understanding-ansible-remote-user/31430/4 "2019-10-07T17:02:38Z")

</div>

Thank you so much to both of you 🙂

The fact is that I started doubting about this basic concept when I tried to create a new USER4 in the managed host, and I faced several troubles to connect as USER4 (remote\_user).  
Despite of exchanging the SSH Pub Keys I still facing the PERMISSION DENIED error, but this belongs to another thread…

Thank you!
