Polkit
(formerly PolicyKit
) provides a centralized way to define and manage policy rules for privileged operations performed by users on Linux systems. This documentation explains its role, potential issues when disabled, and methods for managing it.
}}
= Introduction =
{{stub}}
= Issues when disabling Polkit =
* Reboot and poweroff from the GUI are no longer possible.
This is because systemd treats rebooting as a privileged operation.
* Removable media can no longer be mounted, as udisksd
treats removable media mounting as a privileged operation.
* Graphical user creation tools (e.g. users-admin
from gnome-system-tools
) no longer function properly.
Probably because accountsservice
treats user creation as a privileged operation.
* Flatpaks can no longer be installed user-locally. (flatpak --user install
)
Flatpak installation errors out:
Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) Warning: Failed to get revokefs-fuse socket from system-helper: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms) error: Failed to install org.gnome.Platform: Failed to activate service 'org.freedesktop.Flatpak.SystemHelper': timed out (service_start_timeout=25000ms)* Network configuration via
nmtui
or similar tools (likely including the network widget in the panel) will probably no longer be configurable, as NetworkManager treats network reconfiguration as a privileged operation.
* System usually takes longer to boot, likely due to processes repeatedly failing to start polkit.
= Disabling Polkit =
Disabling Polkit can be useful for security hardening inside browser-only VMs or other scenarios where a user is not expected to perform any privileged operations via polkit.
How to disable polkit as an opt-in hardening option? [[Undocumented]].
= Development =
Polkit could be disabled using a systemd drop-in configuration snippet, modifying polkit.service
by adding ConditionKernelCommandLine
or a similar parameter to prevent polkit from starting in user sessions (outside of the [[sysmaint]] session).
[[Untested]].
{{Open with root rights|filename=
/usr/lib/systemd/system/polkit.service.d/99_sysmaint.conf
}}
Paste.
{{CodeSelect|code=
ConditionKernelCommandLine=boot-role=sysmaint
}}
Save.
Reboot.
Done.
polkit.service
should now only be running in sysmaint session.
= Forum Discussion =
* https://forums.kicksecure.com/t/investigate-security-suid-impact-of-polkitd-and-policykit-libraries/1075
= Footnotes =
{{reflist|close=1}}
{{Footer}}
[[Category:Documentation]]