Search Linux Audit Logs with ausearch
Query the kernel audit log with ausearch for security-relevant events — logins, file access, or specific commands — in readable form.
01Command
$ sudo ausearch -k logins --interpret02What it does
auditd records events according to rules you set with auditctl (for example -w /etc/passwd -p wa -k passwd-changes), and ausearch is the tool that queries the resulting log. The -k option filters events by the key assigned in the rule, while --interpret translates user IDs, timestamps, and syscall numbers into human-readable values — without it the output is mostly numbers. Other useful filters are -ua username (by user), -f /path (by file), and -ts today (time range).
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- ausearch(8) — Ubuntu manual pageEvidence: Documents ausearch -k <key> to query audit records by rule key and --interpret to decode numeric fields into readable text.
- auditctl(8) — Ubuntu manual pageEvidence: Shows how audit rules are created with -k keys, which ausearch later uses to filter matching events.
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.