Review sudo Activity with journalctl
See who ran sudo commands — and who failed authentication — by filtering the systemd journal for sudo entries.
01Command
$ journalctl _COMM=sudo --since today02What it does
Every sudo invocation is logged to the systemd journal, and journalctl can filter by any field: _COMM=sudo narrows to the sudo binary, while --since today (or -S "2026-09-01") bounds the time window. Each entry shows the invoking user, the TTY, and the command run; lines with "incorrect password attempts" or "user NOT in sudoers" flag failed or unauthorized tries. On Debian/Ubuntu, journalctl -q -g 'sudo|authentication failure' also catches login failures from other sources.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- journalctl(1) — Linux manual pageEvidence: Documents filtering journal output by fields such as _COMM and by time with --since.
- journalctl(1) — Debian manual pageEvidence: Reference for journalctl field matching such as _COMM= and time filtering with --since.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Generate a modern Ed25519 public/private key pair in ~/.ssh for authenticating to servers and Git platforms without passwords.
Add or remove read, write, and execute permission for the owner, group, or others using symbolic or octal modes.
Add a UFW rule to permit inbound traffic on a TCP or UDP port, such as SSH on port 22.