Interview Prep/Linux/SSH, sudo and authentication

`sudo` says `alice is not in the sudoers file. This incident will be reported.`

BeginnerTroubleshootingSSH, sudo and authentication
Answer

Likely causes → The user isn't in the admin group (wheel on RHEL, sudo on Debian/Ubuntu) and has no sudoers rule, or the session predates the group addition.

Diagnose →

id alice
sudo -l -U alice              # as an admin
grep -E '^%(wheel|sudo)' /etc/sudoers

Fix → usermod -aG wheel alice (or sudo), then have them log in again; or add a specific rule in /etc/sudoers.d/.

Prevent → Manage sudo via groups from central identity.

All Linux questions Roadmap: Linux

More on SSH, sudo and authentication