People who code: we want your input. Take the Survey

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
0answers
23 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 ...
0
votes
0answers
10 views

using pkexec makes slow to open new instance of the same gui application

I am working on a project where I need pkexec for the privilege elevation. The below is the get_privilege function is use to run the app with root permissions. # function get_privilege if os.getuid()==...
1
vote
0answers
52 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 ...
1
vote
0answers
402 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-...
0
votes
0answers
39 views

How to customize panel plugins in xubuntu-20.04

I deployed Xubuntu-20.04 with kernel 4.4 on my RK3399 based board and used Network Manager to manage the network. But I found that the frontend tool nm-connection-tool does not work when I want to ...
4
votes
2answers
712 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 ...
2
votes
0answers
123 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 ...
1
vote
2answers
517 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 ...
1
vote
2answers
642 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 ...
3
votes
1answer
770 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 ...
1
vote
0answers
69 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 ...
1
vote
0answers
538 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. ...
3
votes
1answer
271 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 ...
0
votes
0answers
46 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:...
0
votes
1answer
105 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 ...
1
vote
0answers
189 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 ...
3
votes
0answers
176 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 ...
2
votes
1answer
1k 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 ...
2
votes
0answers
104 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 ...
1
vote
0answers
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 ...
0
votes
0answers
1k 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 ...
1
vote
0answers
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 ...
5
votes
3answers
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, ...
2
votes
0answers
219 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 ...
3
votes
0answers
1k 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 ...
1
vote
1answer
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 ...
0
votes
2answers
697 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 ...
21
votes
1answer
2k 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 ...
24
votes
2answers
18k 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: ...
0
votes
1answer
219 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....
3
votes
1answer
5k 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 ...
0
votes
1answer
2k 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 ...
1
vote
2answers
800 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 ...
7
votes
1answer
407 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 ...
13
votes
2answers
9k 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 ...
52
votes
5answers
203k 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 ...
2
votes
2answers
2k 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 ...
3
votes
0answers
59 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 ...
-1
votes
1answer
666 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 ...
0
votes
1answer
157 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. ...
12
votes
1answer
8k 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 ...
3
votes
0answers
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 ...
2
votes
0answers
84 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 ...
8
votes
2answers
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 ...
34
votes
3answers
32k 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: ...
8
votes
3answers
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 ...