Get email notification for using 'sudo' by a specific user
After some experimentation, I found the answer. To set options such as mail_always
or root_pw
for specific users, you can add a line like this to your sudoers
file after opening with visudo
:
Defaults:USER_NAME mail_always
Just make sure that this line is inserted near the top, where the other Defaults
options are. In addition, if you want to specify the recipient of the emails:
Defaults mailto="[email protected]"