[image] northlean: but rather what is the recommended way in say python or bash get permissions to do something like update a package or modify a system wide config file. I want to make a graphical frontend to do some administration tasks. For things like that, I could use sudo, but I was wonder… Answer from Herzenschein on discuss.kde.org
🌐
ArchWiki
wiki.archlinux.org › title › Polkit
polkit - ArchWiki
It provides an organized way for non-privileged processes to communicate with privileged ones. In contrast to systems such as sudo, it does not grant root permission to an entire process, but rather allows a finer level of control of centralized system policy.
🌐
ADMIN Magazine
admin-magazine.com › Articles › Assigning-Privileges-with-sudo-and-PolicyKit
Assigning Privileges with sudo and PolicyKit » ADMIN Magazine
In contrast to sudo, PolicyKit regulates individual (system) functions. Thus, the admin can allow klaus to update packages and keep him from installing new packages. PolicyKit has been through a paradigm change in the course of its development.
Discussions

Should I use sudo or policykit for requesting permissions?
One dilemma I’m in is should I need permissions to say for example, modify a config file that rests under /etc, would there be less window of opportunity for disaster if I ran only the command with sudo or use pkexec (policykit) to obtain one time permissions? More on discuss.kde.org
🌐 discuss.kde.org
12
0
March 14, 2025
[Feature Request] Use `polkit` rather than `sudo`
When looking in some Linux distributions we can see that there are very few packages depending in sudo (nearly all of those optionally depending on it), while most of them especially GUI ones depends on polkit for running things as super... More on github.com
🌐 github.com
19
April 25, 2023
What's the difference between askpass and polkit? GUI prompt for sudo
Iirc systemctl without sudo should prompt a polkit. More on reddit.com
🌐 r/archlinux
1
2
August 13, 2022
Mageia forum • View topic - [SOLVED]gksu aka gksu-polkit vs local sudoers policy
Defaults targetpw # ask for the ... gksu and rely on beesu which doesn't do this... Is there a way to configure ALL polkit processes to require something like what targetpw does for sudoers, for any/all user access to admin related tasks?... More on forums.mageia.org
🌐 forums.mageia.org
July 21, 2015
🌐
BunsenLabs Linux Forums
forums.bunsenlabs.org › viewtopic.php
Sudo vs Polkits / Help & Support (Other) / BunsenLabs Linux Forums
In contrast to sudo, PolicyKit regulates individual (system) functions. So polkit is a framework that allows individual actions (such as drive mounting, for example) to be controlled at a fine-grained level that is impossible with /etc/sudoers
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
SOLVED polekit as a replacement for sudo? / System Administration / Arch Linux Forums
Note: This does not preclude running GParted by means which do not respect polkit, such as the command line. Therefore, polkit should be used to expand access to privileged services for unprivileged users, rather than try to curtail the rights of (semi-)privileged users. For security purposes, sudoers is still the way to go.
🌐
Hacker News
news.ycombinator.com › item
Did you know that polkit, the systemd replacement of sudo, uses JavaScript to va... | Hacker News
January 26, 2017 - This was the response: https://lists.freedesktop.org/archives/systemd-devel/2016-De · systemd is a bomb waiting to go off, IMHO
🌐
KDE Discuss
discuss.kde.org › development
Should I use sudo or policykit for requesting permissions? - Development - KDE Discuss
March 14, 2025 - One dilemma I’m in is should I need permissions to say for example, modify a config file that rests under /etc, would there be less window of opportunity for disaster if I ran only the command with sudo or use pkexec (po…
🌐
Medium
medium.com › @clh0524 › a-brief-introduction-for-sudo-alternatives-doas-and-polkit-ab82eab436d0
A Brief Introduction for sudo alternatives — doas and polkit
February 28, 2021 - Unlike sudo, it does not grant root permission to a whole process, but allows a finer control of control of centralized system policy [3]. What’s more, polkit restricts actions - such as running dd - and users by group or by name.
🌐
Cuda-chen
cuda-chen.github.io › security › 2021 › 03 › 01 › doas-and-polkit-a-brief-introduction.html
A Brief Introduction for sudo alternatives – doas and polkit
March 1, 2021 - Unlike sudo, it does not grant root permission to a whole process, but allows a finer control of control of centralized system policy [3]. What’s more, polkit restricts actions – such as running dd – and users by group or by name.
Find elsewhere
🌐
Debian
wiki.debian.org › PolicyKit
PolicyKit - Debian Wiki
It is sometimes referred to as "the sudo of systemd". While PolicyKit has been replaced by polkit (which rewrote system component, breaking backwards compatibility) in many distributions, Debian continues to use PolicyKit from Debian 7 wheezy through Debian 10 buster.
🌐
Wikipedia
en.wikipedia.org › wiki › Polkit
Polkit - Wikipedia
1 week ago - Nevertheless, as with sudo, several privilege escalation vulnerabilities have been found in polkit. The memory corruption vulnerability PwnKit (CVE-2021-4034) discovered in the pkexec command (installed on all major Linux distributions) was announced on January 25, 2022.
🌐
GitHub
github.com › korcankaraokcu › PINCE › issues › 177
[Feature Request] Use `polkit` rather than `sudo` · Issue #177 · korcankaraokcu/PINCE
April 25, 2023 - We can restrict privileges to our ... Inside a desktop environment polkit is integrated to show a GUI prompt to enter your password, while sudo require a terminal to enter your password....
Author   korcankaraokcu
🌐
Medium
clh0524.medium.com › a-brief-introduction-for-sudo-alternatives-doas-and-polkit-ab82eab436d0
A Brief Introduction for sudo alternatives — doas and polkit | by Lu-Hsuan Chen | Medium
February 28, 2021 - Unlike sudo, it does not grant root permission to a whole process, but allows a finer control of control of centralized system policy [3]. What’s more, polkit restricts actions - such as running dd - and users by group or by name.
🌐
Reddit
reddit.com › r/archlinux › what's the difference between askpass and polkit? gui prompt for sudo
r/archlinux on Reddit: What's the difference between askpass and polkit? GUI prompt for sudo
August 13, 2022 -

What's the difference between askpass and polkit?

I wanted a GUI prompt for sudo command in a script since the script should be executed from dmenu so there will be no terminal. In the script I have the command sudo systemctl start libvirtd, for example.

At first it seemed like I simply need to install lxqt-policykit (I'm using a Sway window manager so I don't have a desktop environment that probably supports this) and run lxqt-policykit-agent on startup. That seems to have no effect. So I think I think I need askpass program as suggested by sudo -A option. I installed lxqt-openssh-askpass (nearly all askpass programs I've come across mention ssh, not sure if this is appropriate for my usage?) and modified the command to SUDO_ASKPASS=/usr/bin/lxqt-openssh-askpass sudo -A systemctl start virtmanager.

But it still seems failed to work despite actually being prompted for a GUI now. After I input my password I get prompted again for it.

What is most appropriate for my situation and am I missing anything?

Much appreciated.

🌐
Mageia Forum
forums.mageia.org › en › viewtopic.php
Mageia forum • View topic - [SOLVED]gksu aka gksu-polkit vs local sudoers policy
July 21, 2015 - sudoers or sudo does not have anything to do with sudo graphical replacements like gksu/kdesu. polkit does not have anything to do with sudoers. sudo is discouraged for graphical tools. You need to adjust the polkit policy for each tool or adjust the global polkit policy.
🌐
SUSE
documentation.suse.com › sles › 12-SP5 › html › SLES-all › cha-security-policykit.html
Authorization with Polkit | Security and Hardening Guide | SLES 12 SP5
April 8, 2026 - Based on its configuration—specified ... authorization programs such as sudo, Polkit does not grant root permissions to an entire session, but only to the action in question....
🌐
LWN.net
lwn.net › Articles › 859075
Why use polkit? [LWN.net]
June 11, 2021 - Posted Jun 11, 2021 0:45 UTC (Fri) by nickodell (subscriber, #125165) Parent article: Privilege escalation with polkit: How to get root on Linux with a seven-year-old bug (GitHub blog)
🌐
ArchWiki
wiki.archlinux.org › title › Polkit_(Русский)
polkit (Русский) - ArchWiki
Данный фреймворк ... sudo, Polkit не наделяет процесс правами суперпользователя, а позволяет точно контролировать, какие действия разрешены, а какие нет...
🌐
ArchWiki
wiki.archlinux.org › title › Polkit_(Français)
polkit (Français) - ArchWiki
Il fournit un moyen organisé pour ... Contrairement à des systèmes tels que sudo, il n'accorde pas l'autorisation root à un processus entier, mais permet plutôt un niveau de contrôle plus fin de la politique système centralisée....