How to log all sudo commands
Sometimes it’s necessary to log all the sudo commands run in your environment. Let”s see how to achieve this. Edit the sudoers file by running visudo visudo Add the below line to the Defaults section Defaults logfile=/var/log/sudo Now all the commands from a sudo user will be logged in /var/log/sudo file. [root@awsadminz ~]# cat /var/log/sudo Jan 11 …