gksu removed from the repo's of Ubuntu 18.04

Chat about Linux in general
MintBean

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

Post 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.
User avatar
thx-1138
Level 8
Level 8
Posts: 2114
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

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

Post 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?
User avatar
Pjotr
Level 22
Level 22
Posts: 15765
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

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

Post 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.
Tip: 10 things to do after installing Linux Mint 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
thx-1138
Level 8
Level 8
Posts: 2114
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

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

Post 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...
User avatar
trytip
Level 13
Level 13
Posts: 4895
Joined: Tue Jul 05, 2016 1:20 pm

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

Post 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
Image
faramir9
Level 1
Level 1
Posts: 2
Joined: Fri Dec 29, 2017 2:02 pm
Location: PA

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

Post by faramir9 »

In Xubuntu 18.04, I installed gksu from https://www.ubuntuupdates.org/package_m ... h=1&q=gksu
Mint 18.3 Xfce, Xubuntu 18.04
Thinkpad T420, i5-2430, 12 GB RAM
altair4
Level 20
Level 20
Posts: 10215
Joined: Tue Feb 03, 2009 10:27 am

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

Post 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.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
User avatar
kc1di
Level 16
Level 16
Posts: 6322
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

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

Post 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.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
gm10
Level 20
Level 20
Posts: 10999
Joined: Thu Jun 21, 2018 5:11 pm

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

Post 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.
User avatar
Flemur
Level 18
Level 18
Posts: 8719
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post 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!
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
Flemur
Level 18
Level 18
Posts: 8719
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post 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
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
JeremyB
Level 20
Level 20
Posts: 11736
Joined: Fri Feb 21, 2014 8:17 am

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

Post 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?
cryptodan
Level 1
Level 1
Posts: 7
Joined: Sat Jul 26, 2014 12:28 pm

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

Post 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
User avatar
xenopeek
Level 24
Level 24
Posts: 24927
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

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

Post by xenopeek »

cryptodan wrote:
Thu Jul 05, 2018 12:14 am
How 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.
Image
User avatar
ingeva
Level 3
Level 3
Posts: 193
Joined: Wed Jun 20, 2012 3:39 am
Location: Sandvika, Norway

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

Post 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.
Last edited by ingeva on Fri Jul 06, 2018 6:00 am, edited 2 times in total.
Mint rules! (20.1 MATE) Cinnamon go home! :)
User avatar
Pjotr
Level 22
Level 22
Posts: 15765
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

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

Post 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://.
Tip: 10 things to do after installing Linux Mint 20 Ulyana
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
kc1di
Level 16
Level 16
Posts: 6322
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

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

Post 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.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
User avatar
Mr_Sinister
Level 1
Level 1
Posts: 7
Joined: Sat Jul 08, 2017 3:57 am

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

Post 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.
User avatar
Sir Charles
Level 7
Level 7
Posts: 1895
Joined: Thu Jan 04, 2018 1:00 pm

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

Post 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?
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.
User avatar
xenopeek
Level 24
Level 24
Posts: 24927
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

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

Post 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
Image
Post Reply

Return to “Chat about Linux”