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
23 views

How to use custom commands to paste into system directory

Using thunar as my file manager. Sometimes I want to paste things in the directories that I don't own. Now, I know that I can use the terminal to make a new window with elevated privilages with sudo ...
user avatar
1 vote
1 answer
287 views

How to update and remove Pkexec executable

I came to know that most linux distros(including Ubuntu) have a vulnerability due to PKEXEC. The advice that is given to be safe is to either update the polkit or remove the Pkexec executable. My ...
user avatar
2 votes
1 answer
232 views

How to force policy-kit agent to show full information about command line arguments

I am using Ubuntu Mate 20.04 and pkexec to launch apps with admin privileges if needed. However, when policy agent kit asking to authorize request, there is no enough information to make a decision. ...
user avatar
  • 221
1 vote
0 answers
146 views

Sudo doesn't work, pkexec visudo neither

When I try to run any command with sudo I get this: sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin I ...
user avatar
1 vote
0 answers
88 views

Ubuntu 18.04 - pkexec doesn't start synaptic anymore

Since a couple of days I encounter a problem with one of my app starters in the dash. When I try to start synaptic nothing happens anymore. At least most of the time. Sometimes it starts normally, but ...
user avatar
2 votes
0 answers
995 views

/usr/lib/update-notifier/package-system-locked wants to execute as root

just curious... about 30 minutes after turning on my laptop I've been suprised by a window asking me for root password. Its content was something like (translated): For executing '/usr/lib/update-...
user avatar
  • 161
4 votes
2 answers
1k views

Why pkexec does not launch Qt-based application as root user?

Previously it was told that it is bad idea to use sudo to launch GUI-based applications. So one should use pkexec instead. I remembered it, so I tried this to launch Kubuntu Driver Manager on Kubuntu ...
user avatar
  • 89.6k
2 votes
0 answers
325 views

Configure pkexec to only prompt for password once

When using sudo there is a timeout where you don't have to type the password again for x minutes when you run sudo again. Is it possible to get the same thing for graphical applications which use ...
user avatar
  • 295
1 vote
2 answers
1k views

pkexec authentication fails over ssh X11 forwarding, why?

Connecting from an Ubuntu 18.04 computer to a headless Lubuntu 18.04 computer using X11 forwarding. It works great for apps that don't require root privileges: lxterminal, leafpad, etc. I can run ...
user avatar
1 vote
2 answers
1k views

GParted in Ubuntu 18.04 Wayland is not running

GParted in Ubuntu 18.04 is not running. When I click on GParted, it asks me for a password, then nothing happens and no GParted GUI appears. When I try to launch GParted from the terminal: $ sudo ...
user avatar
3 votes
1 answer
1k views

/etc/sudoers is owned by uid 33, should be 0 [duplicate]

when I try to use sudo -I command, I get this error: sudo: /etc/sudoers is owned by uid 33, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin so I ...
user avatar
1 vote
0 answers
73 views

How to run an application with temporary root access from .desktop file? [duplicate]

Im new in Linux world, and i have a problem what is cant solve for like 17 hours. Im using Ubuntu 18.04.3. I would like to edit my files from the gui, because i don't want to use the nano, or mcedit ...
user avatar
1 vote
0 answers
807 views

pkexec is stating Authentication failure despite my providing root password (which is same as my user password)

Because they decided to ditch gksu for some reason, we are forced to only use pkexec. I am currently very new to Ubuntu 18.04 and I am facing this as an issue probably also because of my incompetence. ...
user avatar
  • 11
2 votes
1 answer
370 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
0 votes
0 answers
67 views

Script allowed to launch without sudo password works in console, but not in .desktop file, and pkexec issues

I have set in /etc/sudoers.d/qgis_2_18 a script to be launched without sudo password: marco ALL=NOPASSWD: /home/marco/Dropbox/bin/qgis_2_18 Content of /home/marco/Dropbox/bin/qgis_2_18: xhost local:...
user avatar
0 votes
1 answer
132 views

Show user-friendly name in pkexec

I am trying to make pkexec show my program's user-friendly name rather than its path. For example, Synaptic Package Manager says "Synaptic Package Manager," rather than "/usr/sbin/synaptic" in its ...
user avatar
1 vote
0 answers
282 views

"pkexec xfce4-terminal" has stopped working - help with troubleshooting, please

I have been using an upgraded xubuntu machine (16.04 to 18.04) for just under a year now. I use a root terminal extensively, so on about the 2nd day after my upgrade I figured out how to get it ...
user avatar
  • 593
3 votes
0 answers
219 views

pkexec hanging in gnome 3.28 & xorg, takes forever to proceed, how to fix it?

After the OS is running for a while, it may trigger for a bug that caused pkexec (including any application that use it, including synaptic) to hang. This can only be recovered from relaunching OS or ...
user avatar
2 votes
1 answer
2k views

pkexec on WSL Error

Launching pkexec synaptic in the below environment fails. My PC specsare: xfce desktop ubuntu 18.04 on WSL VcxSrv for X server Here is the output: ~$ pkexec synaptic Error getting authority: Error ...
user avatar
2 votes
0 answers
136 views

Sometimes PKExec does nothing and just hangs, is this a bug?

Sometimes when I run $ pkexec echo test (it happens with any program) after the computer has been on for a while, no graphical dialogue "Authentication required" appears, and pkexec just hangs ...
user avatar
  • 1,592
1 vote
0 answers
3k views

Synaptic Package Manager doesn't launch

I installed Synaptic in Ubuntu 18.04 without any error. It appears between applications. but when I try to open it I enter the password and do not open. Results of running pkexec synaptic from the ...
user avatar
0 votes
0 answers
2k views

pkexec deny my password

I am trying to fix an issue where pkexec deny my password on a minimal install from the mini-iso (started with only bash) is there an other root password I am not aware of ? because I only have one ...
user avatar
1 vote
0 answers
3k views

PKEXEC: No display name and no $DISPLAY environment variable [duplicate]

I've installed XAMPP but I haven't got desktop entry so I created one. I'm using pkexec because it requests authorization. The problem is when I run my new desktop file nothing happens after I enter ...
user avatar
5 votes
3 answers
2k views

Replacing gksudo with pkexec: editor doesn't start in current folder

I'm trying to be a good boy and stop using gksudo, especially since it just got orphaned in the 18.04 daily builds (note, this question is not specific to 18.04). In the bad old days of using gksudo, ...
user avatar
2 votes
0 answers
284 views

Gnone-Wayland: Does launching a pkexec prompt from an X11 terminal (ex terminology in xwayland) result in a X11 pkexec prompt?

A few months ago I've learned about some pretty big security holes in X11: such as vulnerability to getting your keystrokes sniffed by other X11 programs, programs being able to send keystrokes (and ...
user avatar
3 votes
0 answers
2k views

Which best practice for using gedit as root? [duplicate]

gksudo seeming to be somehow depreciated since 2017 as I see on the french forum documentation, is there an environment and version agnostic best practice allowing to use gedit as root? (excluding ...
user avatar
  • 131
1 vote
1 answer
1k views

How can I get the username from a python script run with pkexec?

I'm executing a python script as root with pkexec and I'm using working_dir = os.getenv('HOME') to get the username but it always returns root instead of test1 which is the current user. How can I get ...
user avatar
0 votes
2 answers
761 views

Sudo not avaliable, cannot sudo su and root is not enabled [duplicate]

So im stuck in a loop after do something stupid i had a / in a sudo chown command due to my fat fingers, i CTRL-X the operation but not before /etc was changed to a non root user. so now trying to ...
user avatar
  • 23
22 votes
1 answer
3k views

When should I use pkexec and when sudo -i?

I wrote an answer advising the use of sudo -i nautilus. I know that gksu is deprecated, and I was under the impression that sudo -i is how we should run graphical applications as root without killing ...
user avatar
  • 66.7k
31 votes
2 answers
24k views

/etc/sudoers file corrupted and I can't run 'pkexec visudo' over SSH

Following the instruction here I get: pkexec visudo ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/usr/sbin/visudo' as the super user Authenticating as: ...
user avatar
0 votes
1 answer
293 views

Find out which program requested authentication

I get password prompts like the one below every now and then. Usually they say: Authentication is required to change your own user data But I have not requested to do so. This often happens e....
user avatar
  • 101k
3 votes
1 answer
6k views

Error: "The value for the SHELL variable was not found the /etc/shells file" when running `pkexec`

On Ubuntu 14.04, I am getting the error "The value for the SHELL variable was not found the /etc/shells file" when running pkexec to run a script. Most likely this error started after I removed the ...
user avatar
  • 33
0 votes
1 answer
3k views

/usr/bin/pkexec failed

When I am creating an SSH public key and I'm prompted to enter my account's password the terminal returns bash: line 2: .ssh/authorized_keys: Permission denied When I open authorized_keys I cannot ...
user avatar
1 vote
2 answers
835 views

Unable to launch xdiagnose through GUI in normal way

I am in need of doing some diagnostics work with xdiagnose, however when searching for it in the Activities Overview, and then clicking on it, absolutely nothing happens, when in the past it would ask ...
user avatar
7 votes
1 answer
475 views

Is sudo -i less secure than pkexec?

I just heard that it isn't recommended to use sudo -i on GUI programs - because it's less secure. Is there any truth here - is there an advantage to this: sudo -i gedit /random/file.name over ...
user avatar
  • 30.8k
14 votes
3 answers
10k views

pkexec command in a .desktop file

I made a .desktop file for Androxyde's Flashtool (utility for Sony Xperia devices that I have to open with an executable file in its folder) that requires root privileges to use fastboot utilities. I ...
user avatar
  • 524
52 votes
5 answers
225k views

gksu: Gtk-WARNING **: cannot open display: :0

All of the sudden gksu stopped working for me: ~$ gksu gparted (gpartedbin:24252): Gtk-WARNING **: cannot open display: :0 The same happens with gparted-pkexec: ~$ gparted-pkexec No protocol ...
user avatar
  • 1,832
2 votes
2 answers
3k views

Trying to execute a process with pkexec asynchronously and get 'Refusing to render service to dead parents'

I'm trying to execute a process as root from my application that runs with regular privileges using pkexec. When I invoke pkexec synchronously everything is fine but when I run it asynchronously with ...
user avatar
3 votes
0 answers
61 views

How to run applications as root using gksu alternative [duplicate]

When I run applications like Synaptic or Gparted, I'm prompted by the lovely screen on the left, to enter my admin password. I think this has something to do with pkexec. But when I run applications ...
user avatar
-1 votes
1 answer
748 views

revert pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY nautilus

me and my friend were playing around with each others system, and to display a particular pop up on her window through ssh, i used the command pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY ...
user avatar
  • 149
0 votes
1 answer
178 views

After changing kernel , kernel crash is not working

I have changed the kernel in Ubuntu 12.04. After this, if I gave a kernel crash the memory configurations are getting changed and dump file is not created.. It is getting changed from 4GB to 109MB. ...
user avatar
12 votes
1 answer
10k views

How to configure pkexec to not ask for password?

I have a GUI application that needs to call a daemon (written in Python) with superuser privileges. I would like to do this without prompting the user for a password. Since the daemon is a script, I ...
user avatar
3 votes
0 answers
5k views

pkexec can not start any GUI application

I am running Ubuntu 13.04, Gnome 3.6. There is something amiss with pkexec that is not allowing it to start any gui application. pkexec synaptic in a zsh terminal produces a box asking for admin ...
user avatar
  • 3,841
2 votes
0 answers
87 views

Why is pkexec preferred over gksudo for graphical applications? [duplicate]

Please provide Ubuntu documentation that refutes this: https://help.ubuntu.com/community/RootSudo Why, on my fully updated 13.04 system, does pkexec not function? $ pkexec gedit somefile.txt No ...
user avatar
  • 54.7k
8 votes
2 answers
3k views

Can I use pkexec in a python script or a .desktop file?

From the following questions Why is gksu no longer installed by default? When to use pkexec vs. gksu/gksudo? we see that gksu will no longer be supported in the long term, and it will not be ...
user avatar
  • 137k
35 votes
3 answers
39k views

How to configure pkexec?

Reading these questions and answers: When to use pkexec vs. gksu/gksudo? Why is gksu no longer installed by default? brought me another one that will create problems for new users of that command: ...
user avatar
8 votes
3 answers
11k views

pkexec won't launch polkit GUI in Lubuntu / LXDE

I performed a fresh install of Lubuntu 12.04 with minimal desktop, as described here. To clarify, I did a command-line install from the Lubuntu alternative install disc, then I did an apt-get install ...
user avatar
  • 343