Verifying file integrity with debsums

After upgrading my Ubuntu server, some security applications grumped about changed contents of some common binaries.

Just to be safe, I wanted to verify them explicitly with debsums, but debsums looks for package names, not paths to binaries. Here’s a script that validates chattr, find, perl, and lsattr–the “-s” option to debsums is “silent”, so no news is good news:

for i in /usr/bin/chattr /usr/bin/find /usr/bin/perl /usr/bin/lsattr ; do
  echo $i
  debsums -as $(dpkg -S $i | cut -d':' -f1 | sort -u)
done

Related posts:

  1. Randomly sort the lines in a file
    There are times when you need to randomly order the lines in a file. Here’s a script to do just that: #!/usr/bin/perl -w use strict; use List::Util 'shuffle'; my @lines......
  2. OpenDNS updater for linux/ubuntu
    The OpenDNS service is great — it provides anti-phishing and the ability to filter out some of the less desirable detritus from the internets. OpenDNS needs to be periodically notified......
  3. Recursive sort-by-modification-time
    This certainly isn’t rocket science, but it also is certainly not something you want to type more than once. find . -type f -printf '%T@\t%p\n' | sort -n | cut......
  4. Using Mac OS X 10.5′s keychain for ssh
    The version of ssh that comes with Mac OS X 10.5.6 has a -K option that stores your passphrases in your system’s keychain. Run this: ssh-add -K [path to private......