Quick Linux Tip #8:
Try: sudo auditctl -w /etc/passwd -p wa -k passwd_changes
Info: auditd is Linux's audit framework. auditctl sets up a watch on a file. You can then use ausearch later to query those logs.
Examples:
- $ sudo auditctl -w /etc/shadow -p rwxa -k shadow_access
- $ sudo ausearch -k passwd_changes -ts today
- $ sudo aureport --file --summary
Note: Requires the auditd service. auditctl commands run silently and log events in the background. Use ausearch -k <key> later to inspect the generated logs when a file is changed.
Leave a Reply