هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
The quick answer
dnf -y install aide
aide --init
mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
aide --checkOn Ubuntu: apt-get install -y aide, then aideinit and aide --config /etc/aide/aide.conf --check.
Step by step
- Create the baseline on a clean, freshly installed system (quick answer).
--initcan take a few minutes. - Run a check — the summary first, then the details:
aide --check
AIDE found differences between database and filesystem!!
Summary:
Total number of entries: 61234
Added entries: 1
Removed entries: 0
Changed entries: 2
Added entries:
f++++++++++++++++: /usr/local/bin/update-helper
Changed entries:
f ... .C... : /usr/sbin/sshdA changed /usr/sbin/sshd without a patch, or a new file in /usr/local/bin nobody knows = investigate now.
- After a planned change (patches, new package), check the report, then make the new state the baseline:
- What is checked —
/etc/aide.conflists folders and rules. Exclude folders that change all the time:
!/var/log/.*
!/var/lib/containers/.*
/opt/shop/bin NORMAL- Run it every day and send the report — a systemd timer (or cron):
30 4 * * * root /usr/sbin/aide --check > /var/log/aide/aide-check.log 2>&1 || mail -s "AIDE changes on $(hostname)" ops@example.com < /var/log/aide/aide-check.log- Protect the baseline: an attacker with root can update the database too. Keep a copy of
aide.db.gz(and a checksum) off the server and compare from time to time — or use a central tool (Wazuh file integrity monitoring).
Check that it worked
Common problems
| Problem | Cause | Fix |
|---|---|---|
Couldn't open file /var/lib/aide/aide.db.gz | No baseline yet, or not renamed. | aide --init, then mv aide.db.new.gz aide.db.gz. |
| Hundreds of changes every day | Logs, caches, container storage are checked. | Exclude them in aide.conf. |
| Every patch day is "an alert" | Baseline not updated after patching. | aide --update after reviewed changes (part of the patch routine). |
| The check takes very long | Big folders with full checksums. | Exclude data folders; run at night with nice. |
| Report shows nothing for a known change | The folder is not in the config. | Add it with a rule (NORMAL, PERMS). |
| Attacker could change the baseline | Database only on the server. | Copy it off the server; compare checksums. |
Go further
- Command pages: aide, rpm, find.
- Next how-tos: Watch file changes with auditd, Find files with risky permissions, Patch a server with security updates.
- At work: AIDE. Full checks: Lynis, OpenSCAP, Wazuh.
1Why create the AIDE baseline on a freshly installed system?
The baseline is "the good state"; if the system is already changed by an attacker, AIDE treats that as normal.
2What must you do after patching, so AIDE does not report the updates every day?
Review the report, then aide --update and replace the database with the new one.