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”
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”
Leave a Reply
You must be logged in to post a comment.
3talkers…
…