Skip to content

Instantly share code, notes, and snippets.

@wikiti
Created January 8, 2019 13:22
Show Gist options
  • Save wikiti/77be717fbfa507c3509a918592b85cb8 to your computer and use it in GitHub Desktop.
Save wikiti/77be717fbfa507c3509a918592b85cb8 to your computer and use it in GitHub Desktop.
Watch a file for process changes.
# TODO: This does not work
# To add a watcher
sudo auditctl -w </absolute/path/to/file>
# To remove a watcher
sudo auditctl -W </absolute/path/to/file>
# To list auditd rules
sudo auditctl -l
# Check for changes at `/var/log/audit/audit.log`.
# Example
sudo auditctl -w /home/daniel/Desktop/weird.txt -p wa
sudo auditctl -l
# -w /home/daniel/Desktop/weird.txt -p wa
sudo auditctl -W /home/daniel/Desktop/weird.txt -p wa
sudo auditctl -l
# No rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment