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
3
votes
2answers
200 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
21 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 ...
0
votes
0answers
21 views

Use pkexec to launch UI applications as different user (not root)

Ok, so since gksu is not available anymore, how can I use pkexec to launch a UI application as different user (but not root!). I already tried the suggestions from these threads: How to configure ...
1
vote
1answer
58 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
158 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
0answers
198 views

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

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
219 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
161 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
39 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
99 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
114 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
143 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
757 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
95 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
868 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
2k 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
177 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
898 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
605 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 ...
14
votes
1answer
13k 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
149 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
4k 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
765 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
349 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
7k 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 ...
45
votes
4answers
181k 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 ...
1
vote
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
57 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
568 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
136 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
6k 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
2k 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 ...
32
votes
2answers
26k 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: ...
7
votes
3answers
10k 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 ...