When a user not in sudoers tries to elevate privileges to root (in Ubuntu 18.04 for example) the OS displays this alert: "Username is not in the sudoers file. This incident will be reported".
Now, where can the admin see this report? How can admins detect an invalid sudo
attempt?
I'm specifically interested in CentOS 7.
sudo
is configured on your system”. The linked question isn’t Ubuntu-specific, although I note you did appear to ask about Ubuntu in your question. – Stephen Kitt Jul 31 '18 at 14:18