pkexec allows an authorized user to execute PROGRAM as another user. If username is not specified, then the program will be executed as the administrative super user, root.
Questions tagged [pkexec]
22 questions
23
votes
3 answers
How do I run GUI applications as root by using pkexec?
I am using Trisquel GNU/Linux-Libre which comes with Gnome3 Flashback Desktop Environment.
I know that I can run GUI application as root by sudo & gksudo but I want to know that How do I run GUI applications as root with the help of pkexec?
When I…
Pandya
- 23,898
- 29
- 92
- 144
7
votes
2 answers
sudo equivalent in systemd
how to force "machinectl shell" or systemd-run to ask for password in terminal instead of dialog window?
I can run a command as root using:
machinectl shell --uid=root --setenv='DISPLAY=:1.0' --setenv=SHELL=/bin/bash .host /bin/bash -lc…
Badr Elmers
- 432
- 6
- 13
5
votes
1 answer
gksu replacement
In the old days of CentOS 5 i had an application that run as another user.
I created a .desktop file which run a command that looked like this:
gksu -u anotheruser someapplication
When the user clicked the icon a popup asked for the password of…
user1403360
- 2,000
- 1
- 12
- 11
3
votes
5 answers
Where is sudo hiding my root's .Xauthority data?
I just noticed something peculiar about how sudo handles the .Xauthority file:
sudo xauth add $(xauth list | tail -1)
user@server: sudo xauth info
Authority file: /root/.xauthYZ21Nt
File new: no
File locked: no
Number of…
Dmitry Grigoryev
- 7,123
- 2
- 23
- 62
3
votes
1 answer
Permissions of all files and directories in /usr
Oh my.. I just did a terrible mistake: chown -R root:root /usr. Mea [maxima] culpa..
I fixed sudo and pkexec already, but I want to be sure, there is no "sleeping" issue waiting on me in the future.
Could anyone please find out using simple command,…
Fantastic Mr. Fox
- 51
- 1
3
votes
1 answer
pkexec - how do I set a custom timeout for auth_admin_keep when writting a pkexec policy
I was just reading the reference manual written by David Z for pkexec on freedesktop.org:
https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
and
https://www.freedesktop.org/software/polkit/docs/latest/pkexec.1.html
Manual says…
thebunnyrules
- 1,067
- 13
- 20
3
votes
1 answer
Polkit/Consolekit is not working in openRC
some time ago I moved from Systemd to OpenRC. It was very different, to be able to use audio and
webcam I had to add my user to the audio, optical and video group. As some software uses pkexec to be run as
superuser, when I opened them (Because I…
Megver83
- 301
- 3
- 11
2
votes
1 answer
Opening .jar files with `pkexec` and using Desktop Entries to run commands
I am writing a bash script that automates installation of TLauncher (Minecraft launcher) and basic dependency management on USBs running Lubuntu 18.04.
Part of the bash script creates a desktop entry under /usr/share/applications for easy launch…
solidwaffle
- 21
- 2
2
votes
2 answers
su or sudo - how to know which one will work?
I have a bash script (x11docker) that needs to run some commands as root (docker), and some commands as unprivileged user (X servers like Xephyr). The script prompts for password at some point. It should run on arbitrary linux systems without…
mviereck
- 2,377
- 1
- 18
- 18
2
votes
1 answer
How to prohibit users from using pkexec?
I can control which users can run su or gksu by, for example, including the line auth required pam_wheel.so deny group=nosu in /etc/pam.d – then members of group nosu won’t be able to use su or gksu --su-mode.
However, this won’t stop anyone…
gaazkam
- 1,400
- 3
- 10
- 17
2
votes
0 answers
Let polkit/pkexec use another application to ask for my password
I would like pkexec (polkit) to always ask for my password through a particular application and not through the default one. What I need is the equivalent of sudo --askpass.
I would like that so that polkit always uses my gnupg agent and password…
Damien Cassou
- 155
- 6
1
vote
1 answer
Should I worry if 'pkexec' is in a cPanel user's /home/virtfs (CVE-2021-4034)?
The recent security bug CVE-2021-4034 in Linux involves /usr/bin/pkexec. Following media reports (zdnet, etc.) I changed its permission, but also found this file:
/home/virtfs/foo/usr/bin/pkexec for cPanel user foo.
I don't know why a user would…
kitchin
- 131
- 2
1
vote
1 answer
pkexec shows in command line instead of GUI pop-up
I just hopped to Pop!_os yesterday and pkexec executes in terminal.
It also ran into the error:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
Rain
- 21
- 2
1
vote
0 answers
Linux - How to distribute as portable a root-only GUI application
With portable i mean an application that can be used for example for an USB drive, and don't require to 'touch' the OS file-system for run.
Under Windows, I can distribute a .zip -> .exe -> .manifest file with "requestedExecutionLevel" xml tag.…
Clodo
- 11
- 1
1
vote
1 answer
Unable to execute GUI application as a different user using `pkexec`
I have created following policy file at /usr/share/polkit-1/actions/com.xyz.xyz.policy
Nitinkumar Ambekar
- 553
- 4
- 9