brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: debsums -c lists Debian package files that no longer match their checksums

Security
~/tips/tip-security-debsums-changed-files

sudo debsums -c

Shows which installed package files on Debian or Ubuntu were modified since install.

When something on a Debian or Ubuntu box behaves oddly, I want to know whether someone (or something) edited files that came from a package. debsums compares installed files with the checksums dpkg stored.

sudo apt install debsums
sudo debsums -c

-c prints only the files that changed, which also implies -s (silent, only errors). Config files are skipped by default, because you are supposed to change those. Add -a to check them as well, or use -e to check only config files:

sudo debsums -ce

That gives a quick list of every config file you or a script edited, which is handy before an upgrade.

The man page also has debsums -l, which lists packages that have no checksum list at all, so you know what the check cannot cover. The exit status is 2 when files are changed or missing, which makes it easy to use in a script.

Caveat: the man page itself says debsums is mainly for finding locally modified files and is of limited use as a security tool. The checksums live on the same disk as the files, so an attacker with root can change both. For real integrity checking it points to tools like AIDE or Tripwire with a baseline kept somewhere safe. I’d treat debsums as a quick health check, not proof that a box is clean.

Further reading: debsums manual

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link