Overriding file ownership and mode in Debian Linux
dpkg-statoverride command is used in Debian Linux to override file ownership and mode, allowing dpkg to invalidate file ownership and mode during package installation.
dpkg-statoverride(option)-add: Add an overwrite to the file;
--remove: Remove an overwrite for the file;
--list: Display all rewrite lists;
--update: If the file exists, perform the rewrite operation immediately.Modify the permission attributes of a folder:
sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3Forcibly modify the permission attributes of a folder:
sudo dpkg-statoverride --force --update --add root sasl 755 /var/spool/postfix/var/run/saslauthdDelete the file from the database:
sudo dpkg-statoverride --remove /usr/bin/wall