# ansible defaulting to remote user being the same as local -- how to revert?

**URL:** <https://forum.ansible.com/t/ansible-defaulting-to-remote-user-being-the-same-as-local-how-to-revert/11813>\
**Category:** Ansible Project\
**Created:** [August 20, 2012, 6:44pm UTC](https://forum.ansible.com/t/ansible-defaulting-to-remote-user-being-the-same-as-local-how-to-revert/11813 "2012-08-20T18:44:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grzegorz\_Nosek](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@Grzegorz\_Nosek](https://forum.ansible.com/u/Grzegorz_Nosek)\
**Post date:** [August 20, 2012, 6:44pm UTC](https://forum.ansible.com/t/ansible-defaulting-to-remote-user-being-the-same-as-local-how-to-revert/11813/1 "2012-08-20T18:44:12Z")

</div>

Hi,

Since commit:

commit deec50fc3cb154c1b2138bba23fe6cad812f9a11

Default -u (user) and “user:” in playbooks to the current user.

I have to specify “-u root” in every single ansible command (I log into the ansible host as a non-root user but need to connect to managed nodes as root). Is there a way to revert to the previous behaviour, short of maintaining a fork of ansible? E.g. stick the host name in the inventory file (I have it generated anyway).

Best regards,  
Grzegorz Nosek

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 20, 2012, 6:46pm UTC](https://forum.ansible.com/t/ansible-defaulting-to-remote-user-being-the-same-as-local-how-to-revert/11813/2 "2012-08-20T18:46:25Z")

</div>

We are not going to revert since that greatly impairs the ability for people to share playbooks amongst teams where everyone uses their own credentials to manage a system and is using sudo, but ansible now has a configuration file where you can set this, and you should do so if you want this behavior.

see examples/ansible.cfg in the checkout

easily customizable

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Nosek](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@Grzegorz\_Nosek](https://forum.ansible.com/u/Grzegorz_Nosek)\
**Post date:** [August 20, 2012, 7:21pm UTC](https://forum.ansible.com/t/ansible-defaulting-to-remote-user-being-the-same-as-local-how-to-revert/11813/3 "2012-08-20T19:21:23Z")

</div>

W dniu poniedziałek, 20 sierpnia 2012 20:46:25 UTC+2 użytkownik Michael DeHaan napisał:

> We are not going to revert since that greatly impairs the ability for people to share playbooks amongst teams where everyone uses their own credentials to manage a system and is using sudo, but ansible now has a configuration file where you can set this, and you should do so if you want this behavior.
> 
> see examples/ansible.cfg in the checkout
> 
> easily customizable

That’s fine for me, thanks! (BTW, example/ansible.cfg contains the wrong path to the system config file, it’s /etc/ansible/ansible.cfg. my github repo has the fix but already has another pull request pending from that branch)

Best regards,  
Grzegorz Nosek

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 20, 2012, 7:24pm UTC](https://forum.ansible.com/t/ansible-defaulting-to-remote-user-being-the-same-as-local-how-to-revert/11813/4 "2012-08-20T19:24:38Z")

</div>

FYI – You should always start a new branch for each pull request, named after what the pull request is going to contain.

You can delete the branch later.
