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.
Questions tagged [pkexec]
51 questions
57
votes
6 answers
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 specified (gpartedbin:25454): Gtk-WARNING **: cannot open…
d_inevitable
- 1,922
40
votes
3 answers
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: How to configure pkexec for easy usage? For example…
Luis Alvarado
- 217,203
35
votes
2 answers
/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,,, (tuc) Password: polkit-agent-helper-1:…
28
votes
1 answer
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 kittens , but someone commented ' pkexec is the…
Zanna
- 72,471
14
votes
4 answers
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 used to make it work with gksu , but I'm on…
np_3ka
- 544
- 3
- 6
- 22
14
votes
1 answer
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 can't set the SUID bit directly. I could write a C…
Chinmay Kanchi
- 921
9
votes
2 answers
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 installed by default from >= 13.04. Instead we should use…
Takkat
- 144,810
8
votes
3 answers
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 --no-install-recommends lubuntu-desktop .…
ven42
- 453
- 1
- 4
- 11
7
votes
1 answer
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 pkexec gedit /random/file.name I used to use gksudo, but…
Tim
- 33,510
6
votes
3 answers
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 , I'd typically navigate to a folder containing…
Organic Marble
- 24,913
5
votes
1 answer
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 fish shell, that was set as my default shell. The…
J. Doe
- 53
- 1
- 1
- 4
5
votes
2 answers
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 20.04 LTS using terminal as pkexec…
N0rbert
- 103,523
4
votes
1 answer
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. For example, if I run pkexec sh -c 'echo hello'…
ov7a
- 261
4
votes
0 answers
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 pkexec ? I've looked everywhere and all I can find is…
krispy
- 383
3
votes
0 answers
How to run applications as root using gksu alternative
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 using gksu I am prompted by the ugly window on…
Joshua Robison
- 3,083