使用 debsums 自动检查所有已安装的软件包

使用 debsums 自动检查所有已安装的软件包

我想使用debsums检查所有包的完整性

sudo dpkg -l | awk {'print $2'} | xargs | debsums |grep -v OK

但我收到了这些错误:

debsums: can't open fwupd file /var/lib/polkit-1/localauthority/10-vendor.d/fwupd.pkla (Permission denied)
debsums: can't open geoclue-2.0 file /var/lib/polkit-1/localauthority/10-vendor.d/geoclue-2.0.pkla (Permission denied)
debsums: can't open gnome-initial-setup file /var/lib/polkit-1/localauthority/10-vendor.d/gnome-initial-setup.pkla (Permission denied)
debsums: can't open linux-image-5.0.0-31-generic file /boot/vmlinuz-5.0.0-31-generic (Permission denied)
debsums: can't open linux-image-5.0.0-32-generic file /boot/vmlinuz-5.0.0-32-generic (Permission denied)
debsums: can't open linux-modules-5.0.0-31-generic file /boot/System.map-5.0.0-31-generic (Permission denied)
debsums: can't open linux-modules-5.0.0-32-generic file /boot/System.map-5.0.0-32-generic (Permission denied)
debsums: can't open network-manager file /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla (Permission denied)
debsums: can't open packagekit file /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.packagekit.pkla (Permission denied)
debsums: can't open policykit-desktop-privileges file /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla (Permission denied)
debsums: can't open systemd file /var/lib/polkit-1/localauthority/10-vendor.d/systemd-networkd.pkla (Permission denied)

我该如何避免这些错误?为什么甚至 root 都无法读取这些文件?

最后,我想创建一些最小的 rootkit 检测系统,如果有任何输出,它会发送电子邮件

答案1

dpkg -l | egrep '^ii' | awk '{print $2}' | xargs sudo debsums | egrep -v 'OK'

相关内容