pkaction
Query and execute PolicyKit actions
SYNOPSIS
pkaction [OPTIONS...] [ACTION_ID]
Example: pkaction --list-actions
Example: pkaction --action-id org.freedesktop.policykit.exec --verbose
PARAMETERS
--help, -h
Displays a brief help message and exits.
--version
Shows the version of the pkaction command and exits.
--verbose
Provides more detailed output for the specified action ID, including properties like implicit authorization requirements.
--list-actions
Lists all registered Polkit action IDs. This is the default behavior if no ACTION_ID is specified.
--action-id ID
Specifies the unique ID of the Polkit action to query. When provided, pkaction displays detailed information about this specific action.
--dump-system-locale
Dumps the system's current locale settings, which can be relevant for localized action descriptions.
DESCRIPTION
pkaction is a command-line tool used to query and inspect Polkit (PolicyKit) actions. Polkit is an essential authorization framework that defines and handles privileges for system-wide services on modern Linux distributions. This command allows administrators and developers to gain insight into which authorization actions are registered on the system, what properties they possess (such as id, description, vendor, icon, and implicit authorization settings), and any associated annotations.
It's an invaluable tool for understanding the authorization policies enforced by Polkit. Whether you need to list all available actions or retrieve detailed information for a specific action ID, pkaction provides the necessary introspection. This capability is crucial for debugging authorization issues, developing applications that integrate with Polkit, or simply understanding the privilege management landscape of a Linux system. It offers a transparent view into the authorization logic configured by various installed software components.
CAVEATS
The pkaction command requires the Polkit daemon (polkitd) to be running in order to query action information. It only provides introspection capabilities; it cannot be used to modify or configure Polkit policies. The output can be extensive, especially when listing all actions, requiring familiarity with Polkit concepts to fully interpret.
UNDERSTANDING ACTION IDS
Polkit actions are uniquely identified by string IDs, typically following a reverse-DNS naming convention (e.g., org.freedesktop.udisks2.filesystem-mount). These IDs are defined by applications and services that integrate with Polkit for authorization purposes. They represent specific operations that might require elevated privileges or user consent.
IMPLICIT AUTHORIZATION DETAILS
When using the --verbose option with a specific action ID, pkaction displays detailed information about the action's 'implicit authorization' requirements. These include values like auth_self (user needs to authenticate themselves), auth_admin (an administrator needs to authenticate), auth_self_keep, or auth_admin_keep (authentication persists for a session), and no (no authentication required). These settings dictate how Polkit handles authorization requests for that particular action.
HISTORY
Polkit (originally PolicyKit) was developed by David Zeuthen at Red Hat as a fundamental framework for defining and handling authorizations for system-wide services on Unix-like operating systems. It became an integral part of modern Linux distributions, offering a more granular and flexible approach to privilege management compared to older mechanisms.
The pkaction utility has been a standard component of the Polkit suite since its early versions, providing essential introspection capabilities into the registered authorization actions. Its primary function—to query and display details about Polkit actions—has remained consistent, making it a key tool for system administrators and developers working with Polkit-enabled applications.
SEE ALSO
pkexec(1), pkttyagent(1), polkitd(8), polkit(8)