LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

polkit

Authorization framework for system privileges

TLDR

List all registered polkit actions
$ pkaction
copy
Show details for a specific action
$ pkaction --verbose --action-id [org.freedesktop.login1.reboot]
copy
Check if a process is authorized for an action
$ pkcheck --action-id [org.freedesktop.login1.reboot] --process [pid]
copy
Execute a command as another user (default: root)
$ pkexec [command]
copy
Execute a command as a specific user
$ pkexec --user [username] [command]
copy

SYNOPSIS

polkit [options]

DESCRIPTION

polkit (PolicyKit) is an authorization framework that allows non-privileged processes to communicate with privileged ones. It provides fine-grained control over system-wide privileges, enabling desktop applications to perform administrative tasks with proper user authorization.Unlike sudo which grants full root access, polkit defines specific actions (like mounting disks or changing network settings) and policies controlling who can perform them. The framework consists of pkexec (execute privileged commands), pkaction (list/inspect actions), and pkcheck (check authorization). The polkitd daemon runs with minimal privileges and communicates over the system message bus.

PARAMETERS

pkexec

Execute a command as another user with polkit authorization. Defaults to root if no user specified.
pkaction
List or inspect registered polkit actions and their default policies.
pkcheck
Check whether a process or system bus name is authorized for a given action.
polkitd
The polkit system daemon that manages authorization decisions. Runs as the polkitd system user.

CONFIGURATION

/usr/share/polkit-1/actions/

System-wide policy action definition files in XML format.
/etc/polkit-1/rules.d/
Local authorization rules in JavaScript format (polkit >= 0.106).
/etc/polkit-1/localauthority/
Legacy .pkla authorization files for older polkit versions.

INSTALL

sudo dnf install polkit
copy
sudo pacman -S polkit
copy
sudo zypper install polkit
copy
brew install polkit
copy
nix profile install nixpkgs#polkit
copy

CAVEATS

Requires the polkitd daemon to be running. Desktop environments typically provide an authentication agent for graphical prompts. See individual command man pages for detailed options.

HISTORY

PolicyKit was created by David Zeuthen at Red Hat for fine-grained authorization control on Linux desktop systems.

SEE ALSO

pkexec(1), pkaction(1), polkitd(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid