Search code examples
bashshellsudo

sudo change default error message


I'm writing a bash script where I need some custom prompts.

sudo -p "Some custom prompt"

works like a charm, but how can I change de default message that pops up when a user enters te wrong password (if this is possible at all)?

Thanks in advance!


Solution

  • There is a way to change it but it requires to recompile sudo. You can then provide --with-badpass-message on configure step. See sources for reference.

    If you cannot recompile sudo, I do not think it is possible.