# Display username in a SUDO prompt

**URL:** <https://forum.ansible.com/t/display-username-in-a-sudo-prompt/21770>\
**Category:** Ansible Developer\
**Created:** [June 14, 2016, 9:50am UTC](https://forum.ansible.com/t/display-username-in-a-sudo-prompt/21770 "2016-06-14T09:50:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Ovchinnikov](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@Anton\_Ovchinnikov](https://forum.ansible.com/u/Anton_Ovchinnikov)\
**Post date:** [June 14, 2016, 9:50am UTC](https://forum.ansible.com/t/display-username-in-a-sudo-prompt/21770/1 "2016-06-14T09:50:41Z")

</div>

When asking for ‘become’ password, it would be convenient to display a username for which the password will be user later.

Imagine you have several machines (or groups of machines), on each of those there might be different privileged users with different passwords. You specify the remote user in inventory files, so the username might not really be present on the command line, and it’s easy to forget which password you need to use. Would be nice to extend the ‘become’ prompt, so it also displays the username of the remote user, for example:

SUDO password (user “admin”):

How difficult is it to implement, and does it make sense at all?

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 14, 2016, 1:12pm UTC](https://forum.ansible.com/t/display-username-in-a-sudo-prompt/21770/2 "2016-06-14T13:12:50Z")

</div>

For sudo(by default) the user would be the ‘login/remote’ user which can change by play/task/host. For su it would be the user you ‘become’, which can also vary as at every level. So there is really no good way to present this info at the ‘global’ prompt for password input.
