Email notification everytime users run “sudo” on Linux

For Redhat, Centos Systems make sure that sendmail is running on the machine and configured to send out emails.

Run

visudo

Add the following configuration in /etc/sudoers

visudo parses the sudoers file after the edit and will not save the changes if there is a syntax error.

Defaults mail_always
Defaults mailerpath=/usr/sbin/sendmail
Defaults mailto=”root@serverbuddies.com”
Defaults mailsub=”*** Command run via sudo on %h ***”
Defaults mailerflags=”-t”

One Response to “Email notification everytime users run “sudo” on Linux”

  1. 1brackenon 12 Jan 2022 at 9:15 pm

    3talkers…

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.