Questions tagged [pkexec]

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.

Filter by
Sorted by
Tagged with
2
votes
2answers
179 views

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' --...
2
votes
1answer
37 views

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 ...
-1
votes
1answer
196 views

Why I get permission denied output why I run, pkexec /opt/lampp/manager-linux-x64.run ? Is it normal?

I was following a link to add Xampp server in "Show all application" section where normally we can see all GUI apps installed. But it's different in case of Xampp. We have to do things manually. So ...
1
vote
0answers
142 views

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 -> ....
0
votes
1answer
481 views

How to authenticate a user in X11 without gksudo/gksu/pkexec

Are there any alternatives to using gksudo/gksu or pkexec to authenticate users in X11? The only one that comes to mind is creating a wrapper script that uses sudo to ensure my 2-factor ...
1
vote
1answer
954 views

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 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit ...
3
votes
1answer
465 views

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/...
1
vote
2answers
543 views

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 ...
2
votes
1answer
429 views

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 ...
2
votes
0answers
107 views

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 ...
2
votes
1answer
1k views

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 ...
0
votes
1answer
461 views

Unable to pass a command to ssh while using pkexec, gives me an error

I am writing a script that relies on pkexec as the machine is hardened and sudo will not work. I allow pkexec to temporarily not prompt the user for a password, so any command will work directly. If ...
3
votes
1answer
3k views

gksu replacment

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 ...
14
votes
1answer
12k views

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 ...