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

Why pkexec does't change user in terminal?

I am trying to run desktop shortcut as root user, willing to see password prompt on opening shortcut. pkexec does the thing, but it doesn't change user - either i run it from terminal - it always give ...
user453575457's user avatar
1 vote
1 answer
97 views

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 ...
kitchin's user avatar
  • 131
0 votes
1 answer
205 views

pkexec with >> directing output to file

If I try pkexec echo -e '\nwl2k something\n' >> /etc/ax25/axports in terminal to have a user add a line to a file, I get a bash: /etc/ax25/axports: Permission denied How do I make it so the ...
NoBugs's user avatar
  • 56
3 votes
5 answers
1k views

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: ...
Dmitry Grigoryev's user avatar
3 votes
1 answer
867 views

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 ...
Fantastic Mr. Fox's user avatar
1 vote
1 answer
432 views

pkexec shows in command line instead of GUI pop-up [closed]

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....
Rain's user avatar
  • 21
0 votes
1 answer
2k views

How to recover from accidental chmod 777 on /etc/sudoers

I am having a problem with an install of retropie on a raspberry pi where I have accidentally locked out the sudo command. I am about to just re-image my pi and start over unless someone can help me ...
Alturis's user avatar
0 votes
1 answer
428 views

Run sudo Exec in .desktop via pkexec: Qt Error

I have a configuration in virtualbox that requires me to run the application with sudo privileges. I have been editing the .desktop file to run with sudo (note a simply changing the Exec variable to ...
Sterling Butters's user avatar
7 votes
2 answers
3k 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'...
Badr Elmers's user avatar
2 votes
1 answer
293 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 ...
solidwaffle's user avatar
-1 votes
1 answer
1k 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 ...
Pranav's user avatar
  • 139
1 vote
0 answers
218 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 -> ....
Clodo's user avatar
  • 11
0 votes
1 answer
700 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 ...
Walter's user avatar
  • 1,214
1 vote
1 answer
2k 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 ...
Nitinkumar Ambekar's user avatar
3 votes
1 answer
2k 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/...
thebunnyrules's user avatar
2 votes
2 answers
839 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 ...
mviereck's user avatar
  • 2,397
2 votes
1 answer
955 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 ...
gaazkam's user avatar
  • 1,400
2 votes
0 answers
210 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 ...
Damien Cassou's user avatar
3 votes
1 answer
2k 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 ...
Megver83's user avatar
  • 301
0 votes
1 answer
906 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 ...
Alejandro's user avatar
6 votes
1 answer
3k views

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 ...
user1403360's user avatar
  • 2,020
25 votes
3 answers
32k 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 ...
Pandya's user avatar
  • 24.3k