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

Gtk desktop app delayed on first launch (20.04)

I have a Gtkmm desktop app that requires root access. It worked fine on 18.04 using Lxqt-sudo but after upgrading to 20.0.4, it takes ~30 seconds to open only the first time after booting. In addition,...
Mick's user avatar
  • 23
1 vote
2 answers
449 views

Slow startup of gnome-terminal as root

Could anybody help me debug the following issue: I have a menu shortcut that starts up gnome-terminal as root. The shortcut refers to the following .desktop file: [Desktop Entry] Name=Root Terminal ...
raj's user avatar
  • 9,427
0 votes
1 answer
58 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 ...
Charizard_knows_to_code's user avatar
1 vote
1 answer
2k 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 ...
Jason's user avatar
  • 179
2 votes
1 answer
387 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. ...
ov7a's user avatar
  • 241
1 vote
0 answers
273 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 ...
IGNACIO MANSUY's user avatar
1 vote
0 answers
133 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 ...
puppenklo's user avatar
2 votes
0 answers
2k 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-...
M_Ryan's user avatar
  • 171
5 votes
2 answers
2k 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 ...
N0rbert's user avatar
  • 97.4k
3 votes
0 answers
587 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 ...
krispy's user avatar
  • 335
1 vote
2 answers
2k 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 ...
Organic Marble's user avatar
1 vote
2 answers
2k 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 ...
andrew_ysk's user avatar
3 votes
1 answer
2k 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 ...
Matěj Bucek's 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 ...
TrebitschTheReal's user avatar
1 vote
0 answers
1k 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. ...
Charles's user avatar
  • 11
2 votes
1 answer
446 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
0 votes
0 answers
86 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:...
Marco Sulla's user avatar
0 votes
1 answer
168 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
363 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 ...
BISI's user avatar
  • 682
3 votes
0 answers
248 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 ...
tribbloid's 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 ...
nariknahom's user avatar
2 votes
0 answers
162 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 ...
cat's user avatar
  • 1,632
1 vote
0 answers
4k 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 ...
Mohammad Hmodi's 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 ...
Spark_TheCat's user avatar
1 vote
0 answers
4k 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 ...
Boris Boskovic's 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, ...
Organic Marble's user avatar
2 votes
0 answers
330 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 ...
thebunnyrules's 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 ...
nam1962's user avatar
  • 141
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 ...
answerSeeker's user avatar
0 votes
2 answers
817 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 ...
Ozhound's user avatar
  • 23
23 votes
1 answer
4k 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 ...
Zanna's user avatar
  • 69.4k
32 votes
2 answers
29k 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: ...
Thomas Ulrich Christiansen's user avatar
0 votes
1 answer
346 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....
Byte Commander's user avatar
  • 106k
3 votes
1 answer
8k 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 ...
J. Doe's 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 ...
Lee Gildemeester's user avatar
1 vote
2 answers
887 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
534 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 ...
Tim's user avatar
  • 32.3k
14 votes
4 answers
12k 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 ...
np_3ka's user avatar
  • 534
53 votes
6 answers
251k 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 ...
d_inevitable's user avatar
  • 1,882
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 ...
Name is carl's 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 ...
Joshua Robison's user avatar
-1 votes
1 answer
876 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 ...
Haris's user avatar
  • 149
0 votes
1 answer
207 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. ...
Sasikiran Vaddi's user avatar
12 votes
1 answer
12k 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 ...
Chinmay Kanchi's user avatar
3 votes
0 answers
6k 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 ...
deshmukh's user avatar
  • 3,991
2 votes
0 answers
88 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 ...
chili555's user avatar
  • 59.1k
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 ...
Takkat's user avatar
  • 141k
37 votes
3 answers
45k 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: ...
Luis Alvarado's user avatar
8 votes
3 answers
12k 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 ...
ven42's user avatar
  • 413