There's an example in the default sudoers file for having sudo ask for the target user's password instead of the current user's: Defaults targetpw # Ask for the password of the target user I like the way OpenSUSE handles this, in that it changes the password prompt to make it clear that you should enter root's password and not your own. I think it would be nice if the example had the following additional line: Defaults passprompt="%U's password:"
(In reply to Rebecca Cran from comment #0) %U always expands to target user, %u to invoking's user and I found %p is the desired macro to be used here since it expands always to the user password is being required. Respecting targetpw, rootpw or runaspw. I'll add it to sudoers template
A commit references this bug: Author: garga Date: Thu Apr 19 13:09:58 UTC 2018 New revision: 467767 URL: https://svnweb.freebsd.org/changeset/ports/467767 Log: Add an example of prompt that shows which user password is being expected. It's useful when targetpw option is set to avoid confusion. PORTREVISION was not bumped because a new commit is going to happen soon with one more change and it will bump it. PR: 221264 Submitted by: Rebecca Cran <rebecca@bluestop.org> Sponsored by: Rubicon Communications, LLC (Netgate) Changes: head/security/sudo/files/patch-plugins__sudoers__sudoers.in