File Integrity Monitoring on Linux

Updated 5 Oct 2026

File integrity monitoring on Linux can use AIDE, the audit system, eBPF, the kernel measurement feature IMA with Keylime, or Vigilance. Each one answers a different question.

This page gives the commands for each and says what each one can and cannot tell you.

Start Free File Integrity Monitoring Overview

How to run a file integrity check

Run a file integrity check by recording the state of your files once and comparing it with the state later. The simplest check needs no tool beyond sha256sum. Record hashes, store the list off the machine, and check it later.

sha256sum /usr/bin/ssh /usr/sbin/sshd /etc/ssh/sshd_config > baseline.sha256
sha256sum -c baseline.sha256

The second command prints OK or FAILED for each file. This method finds a changed file. It does not find a new file, and it does not say what a change does.

AIDE

AIDE is the standard open-source checker for this job. Its own site calls it a file and directory integrity checker, and it uses the GPL-2.0 license. AIDE. You list the paths and the attributes in a plain-text config file, then run two commands.

aide --init
aide --check

The manual describes --init as creating a database that contains all of the files you selected in your config file. The --check command compares the disk with that database. The --update command does the same check and writes a new database. The manual states that replacing the input database must always be a manual step and must not be automated. AIDE manual. Here is a rule line from the manual, which checks permissions, inode, user and group for the /etc folder.

/etc p+i+u+g

Run aide --check from cron or a systemd timer. Keep the database where an attacker cannot edit it. AIDE also reports every changed file after a package upgrade, so the report grows long on a busy server. See Vigilance and AIDE side by side.

auditd

The Linux audit system records who touched a file as the access happens, which AIDE cannot do. The auditctl manual shows the watch form, where r, w, x and a stand for read, write, execute and attribute change.

auditctl -w /etc/shadow -p wa -k shadow-watch
ausearch -k shadow-watch -i

The same manual says the watch form is deprecated because of poor system performance. It recommends the system call form instead. auditctl manual.

auditctl -a always,exit -F arch=b64 -F dir=/etc/ -F perm=wa -k etc-watch

The -k option of ausearch searches for events by key, and -i turns numbers such as a user id into names. ausearch manual.

eBPF FIM for Linux

eBPF FIM watches file access inside the kernel as it happens, instead of scanning the disk later. The Tetragon project is one example. Its documentation lists file integrity monitoring as a capability and shows policies that hook the Linux security module file hooks, such as file_open. Tetragon documentation.

Tetragon describes its LSM BPF programs as runtime instrumentation of the security hooks by privileged users. That model fits a container host where you want an event at the moment a process opens a sensitive file. A policy example from the project watches /etc/passwd and /etc/shadow.

Check what an eBPF tool records before you choose it. The sources above describe file access events. Ask whether the tool also stores file hashes and compares them with an approved state. If it does not, it cannot tell you that a file differs from last week. Many teams pair an eBPF tool for live events with AIDE or Vigilance for the state of the files.

Runtime integrity with IMA and Keylime

IMA and Keylime prove to a remote verifier that a machine runs only files you approved. IMA is the Integrity Measurement Architecture, a part of the Linux kernel. It has three features: measurement, appraisal and audit. IMA documentation.

Measurement keeps a log of file hashes. If the machine has a TPM chip, IMA also keeps an aggregate value of that log in a platform configuration register. Appraisal checks a file signature or hash and denies access if the check fails. Audit adds the file hash to the audit log. The kernel policy format is in the kernel ima_policy document. You can read the live measurement log as root.

sudo head -n 5 /sys/kernel/security/ima/ascii_runtime_measurements

Keylime is the verifier side. Its documentation calls it a TPM-based, highly scalable remote boot attestation and runtime integrity measurement solution. It began in the MIT Lincoln Laboratory security research team. Keylime documentation. Keylime polls TPM quotes to PCR 10 on the agent and compares the measurements with a runtime policy. A basic runtime policy is a set of golden cryptographic hashes of files in their untampered state. If the hashes do not match, Keylime places the agent in a failed state. Keylime runtime guide. This command adds an agent with a policy.

keylime_tenant -c add --uuid <agent-uuid> --runtime-policy /path/to/policy.json

This route gives the strongest proof, and it takes the most work. You need TPM hardware, a kernel policy, a verifier service and a list of approved hashes. Each software update changes the list, so you must update the policy with every update. It suits a controlled fleet more than a laptop.

Vigilance on Linux

Vigilance checks the state of the files and reports the capability a changed file gained, with no agent and no rule file. It is one binary for Linux, macOS, Windows and the BSDs. Install it, point it at a folder and let it watch.

brew install vigihq/vigi/vigi
vigi ./the-folder
vigi setup

The first run records what is there. Each later run reports what changed. vigi setup installs a scheduled check, and the machine owns that job. To check an update before you install it, hand Vigilance both versions.

vigi diff --old ./xz-5.4.6 --new ./xz-5.6.1

That example uses the xz Utils backdoor. In release 5.6.1, a hidden backdoor shipped inside liblzma that can intercept a remote login. Read the record on the xz Utils backdoor page. A fingerprint check shows that the library changed, and a normal update changes it too. Vigilance shows what the change can do.

Vigilance reads inside deb, rpm, npm, pip and container packages, so you can check a package file before it lands on the server. See the AIDE comparison, the Wazuh comparison and the attack library.

The best monitoring tool for Linux

No single tool is best, because the tools answer different questions. Pick the tool that answers the question you have.

QuestionTool to consider
Did a file on this one server change since I last looked?AIDE. It is free and it is in most distributions.
Who opened or changed this file, and when?auditd, or an eBPF tool such as Tetragon.
Does this machine run only approved files?IMA with Keylime.
Can I trust this update before it lands?Vigilance. It compares the version you run with the new one.
Do I need alerts from many servers in one place?A server-based tool such as Wazuh. See the Wazuh page.

Many teams run two of these. For example, they run AIDE or an audit rule for the live server and Vigilance for each update. For the wider category, read the file integrity monitoring overview. For audit rules that assessors read, see FIM for PCI DSS 4.0.1.

FAQ

What is the best file integrity monitoring tool for Linux?

It depends on the question. AIDE checks one server for free. Auditd records who touched a file. IMA with Keylime proves a machine runs only approved files. Vigilance checks an update before it lands.

How do I run a file integrity check on Linux?

Record a baseline, then compare against it later. With AIDE, run aide --init once and aide --check on a schedule. With plain tools, use sha256sum to record hashes and sha256sum -c to check them.

Try It on Your Own Software.

Show it the version you run today and the one you are about to install.

Download Vigilance Talk to Us

Talk to Us

A question, a pilot, or a bigger fleet? Send a note. It reaches a person.