On a very small server I have
dbus daemons/services not running in order to save resources and harden the server (these are not needed for normal running and they increase the attack surface dramatically). As a result, when I restart a service/daemon I get a warning/error message, e.g.
# systemctl restart named.service Authorization not available. Check if polkit service is running or see debug message for more information.
The process hangs in the foreground (I think the usual
systemd timeout of 90 seconds), then exits.
systemctl command (here, restarting bind) does work! However, the contacting of
dbus (or what else is it?) to check whether root may in fact restart
bind (which would obviously return true) takes 90s to timeout.
So: Is there a way to remove this polkit check as it works anyway (I am root!)?
PS: Please do not suggest to enable+start
polkit services as a fix because the question is how to disable the check. I don't run them for a reason.