Cannot elevate to root in GUI/desktop

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
jelabarre59
Level 2
Level 2
Posts: 58
Joined: Thu Jan 20, 2011 6:57 pm

Cannot elevate to root in GUI/desktop

Post by jelabarre59 » Sun Feb 04, 2018 9:30 am

Whenever I run any applications that would prompt me for my password for sudo (USB Image Writer, gparted, etc), all I get is some flickering dialogue box that *should* be prompting me for a password, but instead it seems it's immediately failing on the password prompt without ever taking a password, and the dialogue immediately goes away. I can use sudo and gksudo from a command line with no problem, but this requires me to know what the specific command for that menu entry is (USB Image Writer is the same utility as the USB formatter, just different command switches. That also fails, obviously).

It would seem to be a problem in my profile, since I don't have this happening in other machines.

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Cannot elevate to root in GUI/desktop

Post by austin.texas » Sun Feb 04, 2018 9:59 am

I can't say that I understand what is causing that problem. It could be a problem with pkexec instead of sudo.
Just to check your profile, post the result of the command:

Code: Select all

find $HOME -not -user $USER -exec ls -lad {} \;
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

jelabarre59
Level 2
Level 2
Posts: 58
Joined: Thu Jan 20, 2011 6:57 pm

Re: Cannot elevate to root in GUI/desktop

Post by jelabarre59 » Wed Apr 18, 2018 2:18 pm

austin.texas wrote:
Sun Feb 04, 2018 9:59 am
I can't say that I understand what is causing that problem. It could be a problem with pkexec instead of sudo.
Just to check your profile, post the result of the command:

Code: Select all

find $HOME -not -user $USER -exec ls -lad {} \;
(I didn't set the original post to notify me of replies, so only just seeing this one)

Tried that command, and the only files not owned by me are some files in my source-code subdir, and my anbox emulator (none of which would interface with the system utilities). Thus far I get failures with USB Image Writer/USB Formatter (they work off the same executable), the "LightDM GTK Greeter settings", Grub-Customizer, GParted, and some other similar ones that I can't remember immediately.

User avatar
karlchen
Level 19
Level 19
Posts: 9497
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Cannot elevate to root in GUI/desktop

Post by karlchen » Wed Apr 18, 2018 3:52 pm

Hello, jelabarre59.

I just checked here on my Ubuntu 16.04.4. The application menu item "GParted" launches the command gparted-pkexec. I.e. the user id switch to root is not done by gksudo, but by pkexec.
What you could try in order to find out whether it is this pkexec which causes the problem to you is this:
  • Open a terminal window.
  • Launch GParted by executing

    Code: Select all

    gksudo gparted
    This works correctly? Right?
    Close GParted again.
  • Launch GParted by executing

    Code: Select all

    gparted-pkexec
    Does it work when invoked from the commandline? Does the terminal window display any error messages? In case it does, please, post them here.
Best regards,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

jelabarre59
Level 2
Level 2
Posts: 58
Joined: Thu Jan 20, 2011 6:57 pm

Re: Cannot elevate to root in GUI/desktop

Post by jelabarre59 » Thu Apr 19, 2018 12:21 pm

karlchen wrote:
Wed Apr 18, 2018 3:52 pm
I just checked here on my Ubuntu 16.04.4. The application menu item "GParted" launches the command gparted-pkexec. I.e. the user id switch to root is not done by gksudo, but by pkexec.
What you could try in order to find out whether it is this pkexec which causes the problem to you is this:
  • Open a terminal window.
  • Launch GParted by executing

    Code: Select all

    gksudo gparted
    This works correctly? Right?
    Close GParted again.
  • Launch GParted by executing

    Code: Select all

    gparted-pkexec
    Does it work when invoked from the commandline? Does the terminal window display any error messages? In case it does, please, post them here.
"gksudo gparted" works fine (have had to do that before, but some other tools want to behave differently depending on how they're called). "gparted-pkexec" fails.

Code: Select all

~ $ gparted-pkexec
Error executing command as another user: Not authorized

This incident has been reported.

User avatar
karlchen
Level 19
Level 19
Posts: 9497
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Cannot elevate to root in GUI/desktop

Post by karlchen » Sat Apr 21, 2018 5:42 am

Hello, jelabarre59.

Sorry for not coming back earlier. - Could you, please, check whether the executable has still got its "s" bit on the owner:

Code: Select all

ls -l /usr/bin/pkexec
This should return

Code: Select all

$ ls -l /usr/bin/pkexec
-rwsr-xr-x 1 root root 23376 Jan 18  2016 /usr/bin/pkexec
Note the initial rwsr.

Best regards,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

jelabarre59
Level 2
Level 2
Posts: 58
Joined: Thu Jan 20, 2011 6:57 pm

Re: Cannot elevate to root in GUI/desktop

Post by jelabarre59 » Sun Apr 22, 2018 9:26 pm

Same permissions here, date is almost the same.

Code: Select all

-rwsr-xr-x 1 root root 23376 Jan 17  2016 /usr/bin/pkexec

User avatar
Flemur
Level 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Cannot elevate to root in GUI/desktop

Post by Flemur » Mon Apr 23, 2018 10:05 am

jelabarre59 wrote:
Thu Apr 19, 2018 12:21 pm

Code: Select all

~ $ gparted-pkexec
Error executing command as another user: Not authorized
This incident has been reported.
I get the same thing, but with more fluff:
$ gparted-pkexec

Code: Select all

==== AUTHENTICATING FOR com.ubuntu.pkexec.gparted ===
Authentication is required to run the GParted Partition Editor
Authenticating as: lemur,,, (lemur)
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.
In another thread it was reported that "gksudo" is going away, to be replaced by this buggy, touchy "pkexec" and "admin:///" stuff (from freedesktop.org!).

FWIW, I wrote a simple replacement for gksudo:
$ cat bin/Gksudo

Code: Select all

#!/bin/sh
#
xfce4-terminal --command="sudo -H -i -u root bash -c '$*' &" --geometry=45x10 
I tested it with thunar and firefox and it doesn't change settings in your $HOME or take ownership of any files. So far...

In one way it's actually better than the original gksudo because there's a (small) terminal which shows error messages and such.

PS: check :

Code: Select all

ls /usr/share/polkit-1/actions/*part*
/usr/share/polkit-1/actions/com.ubuntu.pkexec.gparted.policy
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

Post Reply

Return to “Cinnamon”