https://jeremy.bicha.net/2018/04/18/gks ... om-ubuntu/
For Mint 19, this'll also affect Synaptic, GParted, Mints Update Manager, etc. And for editing system config files, it almost feels as if we're being pushed towards abusing "sudo".

gedit admin:///etc/default/grub
to directly open /etc/default/grub for editing with Gedit. I guess that admin:// paths should also work with Linux Mint's developed software on Linux Mint 19 but I haven't tested that yet.As far as I can see, (nearly) all helpers advice "gksudo xed file_name" (or similar) to open a system file with elevated rights. I cannot remember having read "gksu ..." since a very long time. Why should we get pushed to (ab)use sudo? If something like nano should get needed, gksu would be in any case the wrong command. So I do not see a possible abuse and the need for gksu.
I know what you are but what am I
kind of thing they deleted it entirely. That was probably best since the modification by the moderator wasn't the least bit funny.None of the stuff you listed works for me (Xfce Mint18.3). Is it supposed to work now or not?
Code: Select all
$ gparted-pkexec
...
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
$ ls -l /usr/bin/gksudo
If it helps (which I'm guessing it might not), all that @xenopeek mentioned works as described on a Debian Stretch based Distro running XFCE (I'm not on anything Ubuntu-based ATM)Flemur wrote: ↑Sat Apr 21, 2018 10:44 amNone of the stuff you listed works for me (Xfce Mint18.3). Is it supposed to work now or not?
Whether they call themselves "org.freedesktop" or "freedesktop.org", they sure crank out some nasty software:Code: Select all
$ gparted-pkexec ... Password: polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie ==== AUTHENTICATION FAILED === Error executing command as another user: Not authorized This incident has been reported.
https://bugs.debian.org/cgi-bin/bugrepo ... bug=841878
The recommended way of performing operations that require elevated permissions using a GUI is by using the gvfs admin backend, which is available in both Ubuntu 18.04 LTS and 17.10, by using the admin:// prefix.
gksu Removed From Ubuntu, Here's The Recommended Replacement
gparted-pkexec
works here:LM 18.3 Xfce)I induced that error by going into Settings > Session and Startup > Application Autostart > and disabled PolicyKit Authorization Agent.tester@vmin183xfce ~ $ gparted-pkexec
==== AUTHENTICATING FOR com.ubuntu.pkexec.gparted ===
Authentication is required to run the GParted Partition Editor
Authenticating as: tester,,, (tester)
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized
This incident has been reported.
With "now" I meant Ubuntu 18.04 / Linux Mint 19, if that wasn't clear from context. I'm not sure if it should all already work on Ubuntu 16.04 / Linux Mint 18.3.
Code: Select all
#!/bin/sh
#
# Use this when gksu goes away.
#
# BZZZZT wrong: xfce4-terminal --command="sudo -H $* " --geometry=40x8
#
xfce4-terminal --command="sudo -H -i -u root bash -c '$*' " --geometry=40x8
Code: Select all
Gksudo thunar /path
-H
switch it points out the issue Pjotr made in his original post:
In Ubuntu 18.04 this runs fine:And for editing system config files, it almost feels as if we're being pushed towards abusing "sudo".
Code: Select all
sudo gedit /etc/fstab
sudo gedit /etc/fstab
runs the entire gedit process as the root user, with full system wide privileges.gedit admin:///etc/fstab
EDITOR=gedit sudoedit /etc/fstab
sudoedit /etc/fstab
. xed on Linux Mint 18.2 and 18.3 also works well with sudoedit thanks to JosephM.pkexec gedit
followed by the filename after using https://raw.githubusercontent.com/hotic ... dit.policyWhat part of my post did you not understand. Your entire explanation is something the new user would have to search to find. He may know sudo because he's seen it and probably used it before. That was the point of Pjotr's comment. He may know gksu because it's in many HowTo's. That ws the point of my original post.xenopeek wrote: ↑Sat Apr 21, 2018 12:49 pmUsingsudo gedit /etc/fstab
runs the entire gedit process as the root user, with full system wide privileges.
As noted you can do it instead with the gvfs admin:// paths:
gedit admin:///etc/fstab
Or in Nautilus press Ctrl+L and type the admin:// path and then any text file opened from there opens for editing in Gedit.
Or using sudoedit, which make a temporary copy of the file and opens the editor with that, only using elevated privileges for it moving the edited file back to original location afterwards:
EDITOR=gedit sudoedit /etc/fstab
You can put EDITOR=gedit in your ~/.bashrc for convenience so you just run:sudoedit /etc/fstab
. xed on Linux Mint 18.2 and 18.3 also works well with sudoedit thanks to JosephM.
All three methods run the gedit process as yourself, not as the root user.
gedit admin:///etc/default/grub
works fine in Ubuntu Bionic, but in Xubuntu Bionic mousepad admin:///etc/default/grub
doesn't (yet?).... I still haven't tested Lubuntu.gksudo
. It would certainly be a great help if gksudo would generate a warning, preferably with an instruction for an alternative. Otherwise, I'm afraid a massive abuse of sudo will occur....How about
xdg-open admin:///etc/default/grub
?