Stop emailing me bad sudo password attempts
Solution 1:
From man sudoers
:
mail_badpass Send mail to the mailto user if the user running sudo
does not enter the correct password. If the command
the user is attempting to run is not permitted by
sudoers and one of the mail_all_cmnds, mail_always,
mail_no_host, mail_no_perms or mail_no_user flags are
set, this flag will have no effect. This flag is off
by default.
The flag is off by default - but enabled by Ubuntu's default /etc/sudoers file, as you have noted.
Presumably, you have started receiving these messages because sudoers
default mailto
is root
- and you configured an MTA to deliver root's mail for cron
. The messages should stop if you comment out the Defaults mail_badpass
line (using sudo visudo
).