I noticed in the latest Ubuntu that their sudo now prompts for a password like so: [sudo] password for username: Instead of gentoo sudo's simple: Password: I think Gentoo should copy Ubuntu's behavior, because there are particular cases where this could be catastrophic, causing password information to be leaked. One that I have actually been bitten by before is this: # sudo mount -t cifs //1.2.3.4/smb /mnt/smb -o username=username Password: *** It only asked me for the password once, so I typed my username's password first, assuming that it was sudo asking for me user's password. Unfortunately, it was actually mount.cifs asking for the Samba password, and so the Samba administrator could potentially have gotten my local machine's user password because the sudo prompt is the same for both programs. I realize that Samba has challenge/response auth, so in this particular case I am probably safe, but that's the besides the point. I still think the sudo password prompt should be slightly more descriptive, and this would be really easy to fix. Reproducible: Always Steps to Reproduce: 1. sudo Actual Results: Password: Expected Results: [sudo] Password for username:
From the sudo man page: -p prompt The -p (prompt) option allows you to override the default password prompt and use a custom one. The following percent (`%') escapes are supported: %H expanded to the local hostname including the domain name (on if the machine's hostname is fully qualified or the fqdn sudoers option is set) %h expanded to the local hostname without the domain name %p expanded to the user whose password is being asked for (respects the rootpw, targetpw and runaspw flags in sudoers) %U expanded to the login name of the user the command will be run as (defaults to root) %u expanded to the invoking user's login name %% two consecutive % characters are collapsed into a single % character The prompt specified by the -p option will override the system password prompt on systems that support PAM unless the passprompt_override flag is disabled in sudoers. So, make an alias in your .bashrc: %% sudo -p "[sudo] password for %p: " bash [sudo] password for my_user: %%
Closing as WONTFIX. In your particular case, *you* set sudo not to ask you a password, which among other things is not the default configuration. And as Jeremy pointed out, it's user configurable.