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
1 vote
1 answer
66 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 ...
user avatar
  • 131
0 votes
1 answer
36 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 ...
user avatar
  • 56
3 votes
5 answers
323 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: ...
user avatar
0 votes
0 answers
49 views

How can I make pkexec behave more like sudo (specifically to set a guid)?

I am trying to execute certain programs as a different group, since I have implemented some security controls around that group. The interactive shell use case works fine with sudo, since I can type ...
user avatar
  • 161
3 votes
1 answer
181 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 ...
user avatar
0 votes
1 answer
151 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....
user avatar
  • 11
0 votes
1 answer
858 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 ...
user avatar
0 votes
1 answer
198 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 ...
user avatar
5 votes
2 answers
1k 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'...
user avatar
2 votes
1 answer
173 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 ...
user avatar
-1 votes
1 answer
936 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 ...
user avatar
  • 139
1 vote
0 answers
186 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 -> ....
user avatar
  • 11
0 votes
1 answer
602 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 ...
user avatar
  • 1,122
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 ...
user avatar
3 votes
1 answer
1k 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/...
user avatar
1 vote
2 answers
790 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 ...
user avatar
  • 2,167
2 votes
1 answer
707 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 ...
user avatar
  • 1,250
2 votes
0 answers
138 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 ...
user avatar
3 votes
1 answer
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 ...
user avatar
  • 189
0 votes
1 answer
754 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 ...
user avatar
5 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 ...
user avatar
  • 2,000
20 votes
3 answers
26k 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 ...
user avatar
  • 21.6k