Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
21 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
73 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 ...
1
vote
1answer
189 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
60 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
2k 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
343 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
741 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
1k 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
79 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
533 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
579 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
394 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 ...
22
votes
1answer
1k 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 ...
7
votes
1answer
5k 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
105 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
2k 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
1k 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
696 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
278 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 ...
9
votes
2answers
4k 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 ...
35
votes
3answers
136k 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
1k 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
43 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
423 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
93 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
5k 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
78 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 ...
29
votes
2answers
18k 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
8k 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 ...