2

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.

Stephen Kitt
  • 434,908
Roberto
  • 23

1 Answers1

4

On CentOS 7 (since that’s apparently what you’re really interested in), such incidents are reported in the journal; run journalctl -xe as root and you’ll see lines such as

guest : user NOT in sudoers

when a user runs sudo without being allowed to, or

guest : 3 incorrect password attempts

when a user gets their password wrong too many times (with other information as usual in log messages).

Stephen Kitt
  • 434,908