Bugzilla – Bug 836
Give hint who (sudo) asks for password entry
Last modified: 2018-05-31 15:39:09 MDT
When I execute e.g. a mount command over sudo I might by queried for two passwords one after the other: First for sudo, then for mount (eg cifs mount with password). While cifs-mount (as well as cryptsetup and others) give a context hint who is asking for the password or for what purpose, sudo does not. So, I often have to think twice what password to enter: me@home ~ $ sudo mount /mnt/cifs-share/ Password: <------- NO CONTEXT HINT GIVEN BY SUDO Password for me@//myserver/share: ******** To make it more clear, something like this would be nice to have: me@home ~ $ sudo mount /mnt/cifs-share/ Password for sudo: Password for me@//myserver/share: ******** Thanks
You can set the sudo prompt in two ways. 1) In the sudoers file. For example, the following line will change the prompt to: [sudo] password for username: Defaults passprompt = "[sudo] password for %p: " 2) By setting the SUDO_PROMPT environment variable. See the sudoers manual for more information on passprompt and the escapes it supports.