The PolicyKit Authorization Daemon
In Ubuntu, the polkitd (PolicyKit daemon) is a system-level background service that acts as an authorization framework. It provides the mechanism for unprivileged processes (like a standard user’s desktop application) to securely request higher privileges. For example, when you try to mount a second hard drive via the GNOME file manager, it is polkitd that intercepts the request and throws the graphical password prompt asking for your sudo credentials.
While PolicyKit is absolutely essential for standard multi-user desktop environments (like GNOME or KDE) to function securely, it is completely unnecessary on deeply stripped-down, single-user servers or minimalist Window Manager setups (like i3wm) where the administrator exclusively uses sudo in the terminal for all privileged tasks. Disabling polkitd on a headless server removes a layer of complexity and slightly reduces memory overhead.
How to Disable the Polkit Daemon
You can stop the authorization daemon using systemctl.
Warning: Do not do this on a standard Ubuntu Desktop. It will break the ability to perform administrative tasks (like installing software or changing network settings) via the graphical interface.
- Open your Ubuntu Terminal or connect via SSH.
- Stop the currently running daemon immediately:
sudo systemctl stop polkit.service
- Disable the service to prevent it from initializing on the next boot:
sudo systemctl disable polkit.service
- (Optional) Mask the service to ensure no other package or update accidentally restarts it:
sudo systemctl mask polkit.service
Your minimalist server will no longer rely on PolicyKit for authorization. All privileged commands must now be executed directly via sudo or as the root user in the terminal.