Page 3 of 7

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Tue Apr 24, 2018 5:14 pm
by MintBean
In Nemo you can browse to a folder, right click on the background in the file display area and select 'open as root.' Displaying a file from the window will then open the editor with elevated privileges.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Tue Jun 05, 2018 7:46 pm
by thx-1138
...now that 19 Beta is actually available, i thought of further asking & bumping up this thread...

Per this discussion here -> viewtopic.php?f=46&t=270632
xed admin:/// returns 'WARNING **: 17:13:04.337: The specified location is not mounted'
So i wanted to ask, is this just a harmless warning coming from the gvfs backend?
Or would pkexec xed be a 'safer' choice instead?

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Wed Jun 06, 2018 4:38 am
by Pjotr
thx-1138 wrote: Tue Jun 05, 2018 7:46 pm ...now that 19 Beta is actually available, i thought of further asking & bumping up this thread...

Per this discussion here -> viewtopic.php?f=46&t=270632
xed admin:/// returns 'WARNING **: 17:13:04.337: The specified location is not mounted'
So i wanted to ask, is this just a harmless warning coming from the gvfs backend?
Or would pkexec xed be a 'safer' choice instead?
You have to provide the full path with admin://. So, for editing /etc/default/grub:

Code: Select all

xed admin:///etc/default/grub
Note that you'll be asked for your password twice, the first time that you use it during a session.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Wed Jun 06, 2018 11:19 am
by thx-1138
Pjotr, using the full path was what returned the warning (xed admin:///etc/initramfs-tools/conf.d/resume)...
So I assume that gvfs maybe is slightly happier by first 'mounting' the admin:// path (ie. opening such in whatever file browser),
and only afterwards opening the file for editing...

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Wed Jun 06, 2018 12:56 pm
by trytip
anyone know if possible to save password when using pkexec so you only have to enter once for session? this is the main reason i use gksu i edit a lot of icons,configs, and misc files in root with multiple programs, having to enter password for every root action will get ridiculous and if possible not use extra services or daemons just for password saving.
using gedit admin:/// you can't any preferences

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jun 28, 2018 11:03 pm
by faramir9
In Xubuntu 18.04, I installed gksu from https://www.ubuntuupdates.org/package_m ... h=1&q=gksu

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Fri Jun 29, 2018 6:23 am
by altair4
In Xubuntu 18.04 there is no need for gksu.

pkexec is a one-to-one replacement for gksu as long as you use the default applications. So these work out of the box:
pkexec thunar & pkexec mousepad

That's possible because Xubuntu took the trouble to create polkit "rules" for their applications.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Fri Jun 29, 2018 7:26 am
by kc1di
Also in Kubuntu you just bring up the editor you want to use and do the edit and when you save it if you need root privileges it automatically asks for you password.
Wish Mint would follow their example here. The pkexec method seems difficult to me.
But it is what it is for now.

Will have to see what rules kubuntu/xubuntu is using and see if it can be incorporated into mint.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Fri Jun 29, 2018 7:37 am
by gm10
kc1di wrote: Fri Jun 29, 2018 7:26 am Also in Kubuntu you just bring up the editor you want to use and do the edit and when you save it if you need root privileges it automatically asks for you password.
Wish Mint would follow their example here. The pkexec method seems difficult to me.
But it is what it is for now.

Will have to see what rules kubuntu/xubuntu is using and see if it can be incorporated into mint.
You are mixing desktop environments and editors here though. The behaviour you describe is a feature of Kate, Kubuntu's default text editor. You can install Kate on Mint if you don't have it, it's in the repo.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Fri Jun 29, 2018 9:28 am
by Flemur
Cosmo. wrote: Sat Apr 21, 2018 6:36 am Why is this a problem?
Because pkexec is a(-nother) complicated kludge from "freedesktop.org" and it'll cause problems.

Code: Select all

$ synaptic-pkexec
==== AUTHENTICATING FOR com.ubuntu.pkexec.synaptic ===
Authentication is required to run the Synaptic Package Manager
Authenticating as: <username>,,, (<username>)
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.
Reported! No session for cookie!

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Fri Jun 29, 2018 9:43 am
by Flemur
Pjotr wrote: Sat Apr 21, 2018 5:41 am it almost feels as if we're being pushed towards abusing "sudo".
That's better than being abused by malware from freedesktop.org.

$ cat bin/Gksudo

Code: Select all

#!/bin/sh
#
# Use this when gksu goes away.
#
xfce4-terminal --command="sudo -H -i -u root bash -c '$*' &" --geometry=45x10

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Fri Jun 29, 2018 10:37 am
by JeremyB
Flemur wrote: Fri Jun 29, 2018 9:28 am
Cosmo. wrote: Sat Apr 21, 2018 6:36 am Why is this a problem?
Because pkexec is a(-nother) complicated kludge from "freedesktop.org" and it'll cause problems.

Code: Select all

$ synaptic-pkexec
==== AUTHENTICATING FOR com.ubuntu.pkexec.synaptic ===
Authentication is required to run the Synaptic Package Manager
Authenticating as: <username>,,, (<username>)
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.
Reported! No session for cookie!
Does synaptic work when you run from the program menu?

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 12:14 am
by cryptodan
How do you run commands like system-config-samba:

I tried using pkexec:

Code: Select all

cryptodan@alphacentauri:~$ pkexec system-config-samba
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/usr/share/system-config-samba/mainWindow.py:62: Warning: invalid (NULL) pointer instance
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: g_object_get: assertion 'G_IS_OBJECT (object)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gdk_pango_context_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_context_set_font_description: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_context_set_base_dir: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_context_set_language: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_new: assertion 'context != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_set_attributes: assertion 'layout != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_set_text: assertion 'layout != NULL' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: PangoWarning: pango_layout_get_unknown_glyphs_count: assertion 'PANGO_IS_LAYOUT (layout)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: Warning: value "TRUE" of type 'gboolean' is invalid or out of range for property 'visible' of type 'gboolean'
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gdk_screen_get_display: assertion 'GDK_IS_SCREEN (screen)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
/usr/share/system-config-samba/mainWindow.py:62: GtkWarning: IA__gdk_keymap_get_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
  self.xml = gtk.glade.XML ("/usr/share/system-config-samba/system-config-samba.glade", domain="system-config-samba")
Segmentation fault (core dumped)
It used to work fine from menu with gksu and gksudo in prior versions of mint including mint 18.3

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 3:14 am
by xenopeek
cryptodan wrote: Thu Jul 05, 2018 12:14 amHow do you run commands like system-config-samba
system-config-samba is from 2008 and aside from two minor build fixes unchanged since. It will require attention from maintainers now to continue to work. The maintainer clearly didn't test it as part of Ubuntu 18.04. There is a bug report for it that has a workaround to be able to use it with pkexec: https://bugs.launchpad.net/ubuntu/+sour ... ug/1772127

The general answer is that GUI programs that need elevated privileges need to be updated to use polkit. In this case neither the developers nor the maintainers appear to have done the work and just packaged a program that doesn't work.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 4:11 am
by ingeva
I copied /usr/bin/gksudo from an 18.3 distribution to my 19 distro. Works just fine.

Well. It doesn't, actually. It doesn't accept the correct password.
Later posts for this theme have revealed that pkexec replaces gksudo.
A simple solution would be to make a link:

cd /usr/bin
sudo ln -s pkexec gksudo

This way you don't have to edit an unknown number of scripts that use gksudo, but when you do: Change to pkexec.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 5:06 am
by Pjotr
ingeva wrote: Thu Jul 05, 2018 4:11 am I copied /usr/bin/gksudo from an 18.3 distribution to my 19 distro. Works just fine.
You're taking risks, though... Note that pkexec is by design more secure than gksu (which is why gksu was abandoned in the first place), and furthermore: gksu doesn't get any security updates anymore.

I advise to go with the flow, and switch to pkexec and admin://.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 5:12 am
by kc1di
MintBean wrote: Tue Apr 24, 2018 5:14 pm In Nemo you can browse to a folder, right click on the background in the file display area and select 'open as root.' Displaying a file from the window will then open the editor with elevated privileges.
This works in caja also.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 8:00 am
by Mr_Sinister
kc1di wrote: Thu Jul 05, 2018 5:12 am
MintBean wrote: Tue Apr 24, 2018 5:14 pm In Nemo you can browse to a folder, right click on the background in the file display area and select 'open as root.' Displaying a file from the window will then open the editor with elevated privileges.
This works in caja also.
Nope,
Just upgraded from 18.3 to 19 and this particular feature is gone. And I need it badly.

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 8:04 am
by Sir Charles
Nope,
Just upgraded from 18.3 to 19 and this particular feature is gone. And I need it badly.
That's odd.It works in Ubuntu 18.04 MATE. Why would Mint have removed the option? Can you open Caja with:

Code: Select all

pkexec caja
from a terminal?

Re: gksu removed from the repo's of Ubuntu 18.04

Posted: Thu Jul 05, 2018 8:17 am
by xenopeek
It's called "Open as Administrator". Mr_Sinister apparently is searching for "Open as Root" which is the same thing though :wink:

For even safer use you can click the pen icon button at the start of the location bar in Caja and prefix the path with admin:// (e.g., admin:///etc for /etc). Or from terminal: caja admin:///etc