[SOLVED] su-to-root not working

Forum rules
Before you post please read how to get help
Post Reply
powerhouse
Level 6
Level 6
Posts: 1048
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

[SOLVED] su-to-root not working

Post by powerhouse » Sat Jul 14, 2018 12:13 pm

I've been using luckybackup for the past few years. When it installs, it creates the following launcher entry to start as superuser:

Code: Select all

su-to-root -X -c /usr/bin/luckybackup
This has worked fine until Linux Mint 18.3. Now with Linux Mint 19 it doesn't work, nor does any other option work :cry: .

I tried pkexec, sudo -i, gksudo, you name it.

What has changed and how do I run this application in a root environment (user=root, home=root), like sudo -i.

It's a graphical application.

P.S.: Running

Code: Select all

sudo -i luckybackup
in a terminal window works.
Last edited by powerhouse on Thu Jul 19, 2018 1:49 pm, edited 1 time in total.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 850 250GB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

JeremyB
Level 18
Level 18
Posts: 8854
Joined: Fri Feb 21, 2014 8:17 am

Re: su-to-root not working

Post by JeremyB » Sat Jul 14, 2018 12:29 pm

Starting in 18.3 for fresh installs no password was set for the root account basically disabling the use of su

altair4
Level 19
Level 19
Posts: 9152
Joined: Tue Feb 03, 2009 10:27 am

Re: su-to-root not working

Post by altair4 » Sat Jul 14, 2018 12:54 pm

According to the Ubuntu man page for "su-to-root": http://manpages.ubuntu.com/manpages/bio ... oot.1.html
ENVIRONMENT

SU_TO_ROOT_X
Select the su-like program called by su-to-root -X. Supported values are gksu,
kdesu, kde4su, ktsuss,
sux, gksudo and kdesudo. kde4su denotes the KDE4 version of kdesu.

When this variable is not set su-to-root will currently try to use gksu, kdesu,
kde4su, ktsuss, sux and the built-in code, in that order with the exception that
under a KDE session, kdesu and kde4su are prefered over gksu.
There is no gksu, gksudo, whatever the hell ktsuss was, ...

You need to make your own polkit rule: Luckybackup super-user not available after install via Software Manager

EDIT: I deviated from that link at the end and after createing the polkit file I edited /usr/share/applications/luckybackup-gnome-su.desktop and changed this line:

Code: Select all

Exec=su-to-root -X -c /usr/bin/luckybackup
To this:

Code: Select all

Exec=pkexec /usr/bin/luckybackup
Now the existing menu Item will run as root.
Last edited by altair4 on Sat Jul 14, 2018 2:26 pm, edited 2 times in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

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

Re: su-to-root not working

Post by Flemur » Sat Jul 14, 2018 1:07 pm

As far as I can tell, this acts like "gksudo" except you get a terminal instead of a text box to enter the password, so you can use it in menus and such.

Code: Select all

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

Code: Select all

Gksudo command
FWIW, when I updated 18.3 to 19, gksudo and everything else continued to work, but pkexec has never worked anywhere. (I went back to 18.3 until the upgrade path is fixed).
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

powerhouse
Level 6
Level 6
Posts: 1048
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: su-to-root not working

Post by powerhouse » Mon Jul 16, 2018 2:04 pm

Thanks for all the replies. I won't be back at my Linux PC for a couple of days, but will give the suggestions a try. pkexec on the command line didn't work. Perhaps the polkit change will do the job.

The fact that Luckybackup doesn't install the super-user launcher anymore is a bug! It should be fixed.

Changing command syntax with every Linux Mint / Ubuntu release is a bad habit. Instead of improving on gksu/gksudo, why the hell did they have to reinvent the wheel? If car manufacturers would do the same, we would have to relearn driving with every new model that comes out. Yet the steering wheel is in the same place as decades ago, so are brakes, accelerator, the winker and lights switches.

It's ridiculous that I have to post this stupid question on how to do the most basic thing in Linux Mint - how to run a GUI command as super-user - just because of a model upgrade. Imagine you got your new car and need to post on the forum to be able to drive it?

Again thanks to the forum users and admins who helped out here so quickly! But the command line syntax of basic commands SHOULD NOT CHANGE.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 850 250GB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

powerhouse
Level 6
Level 6
Posts: 1048
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: su-to-root not working

Post by powerhouse » Thu Jul 19, 2018 1:47 pm

altair4 wrote:
Sat Jul 14, 2018 12:54 pm
According to the Ubuntu man page for "su-to-root": http://manpages.ubuntu.com/manpages/bio ... oot.1.html
ENVIRONMENT

SU_TO_ROOT_X
Select the su-like program called by su-to-root -X. Supported values are gksu,
kdesu, kde4su, ktsuss,
sux, gksudo and kdesudo. kde4su denotes the KDE4 version of kdesu.

When this variable is not set su-to-root will currently try to use gksu, kdesu,
kde4su, ktsuss, sux and the built-in code, in that order with the exception that
under a KDE session, kdesu and kde4su are prefered over gksu.
There is no gksu, gksudo, whatever the hell ktsuss was, ...

You need to make your own polkit rule: Luckybackup super-user not available after install via Software Manager

EDIT: I deviated from that link at the end and after createing the polkit file I edited /usr/share/applications/luckybackup-gnome-su.desktop and changed this line:

Code: Select all

Exec=su-to-root -X -c /usr/bin/luckybackup
To this:

Code: Select all

Exec=pkexec /usr/bin/luckybackup
Now the existing menu Item will run as root.
Thanks, altair4 !

However, I need to correct this: The original solution you linked to is correct:

Code: Select all

pkexec /usr/bin/luckybackup
Running

Code: Select all

Exec=pkexec /usr/bin/luckybackup
will not ask for a password, and will not change to the /root environment. It will use the LuckyBackup proviles from the user /home/user/.luckyBackup folder. However, all my proviles using root privileges are saved in /root/.luckyBackup.

Code: Select all

pkexec /usr/bin/luckybackup
produces the expected result.

Without your post I would be still looking for the needle in the haystack.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 850 250GB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

altair4
Level 19
Level 19
Posts: 9152
Joined: Tue Feb 03, 2009 10:27 am

Re: [SOLVED] su-to-root not working

Post by altair4 » Thu Jul 19, 2018 2:07 pm

I think we are talking about two different launchers. I actually did this before I made that post so just to make sure we are on the same page:

The original Marziano solution was to:

[Step1] Create the /usr/share/polkit-1/actions/luckybackup.policy file
[Step2] Then to verify that it worked run:

Code: Select all

pkexec /usr/bin/luckybackup
[Step3] Then create a launcher with that same expression: pkexec /usr/bin/luckybackup

What I did was follow Step1 and Step2 then to make it so the original Menu item worked I edited it's launcher by editing: /usr/share/applications/luckybackup-gnome-su.desktop

When you look at the file it was originally set to Exec=su-to-root -X -c /usr/bin/luckybackup
Setting it to pkexec /usr/bin/luckybackup without the Exec= part will make it so the luckyBackup ( super user ) entry in the menu disappear and the .desktop file will not run..

Run the following command to verify for yourself:

Code: Select all

cat /usr/share/applications/luckybackup-gnome-su.desktop
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

powerhouse
Level 6
Level 6
Posts: 1048
Joined: Thu May 03, 2012 3:54 am
Location: Israel
Contact:

Re: [SOLVED] su-to-root not working

Post by powerhouse » Thu Jul 19, 2018 2:18 pm

altair4 wrote:
Thu Jul 19, 2018 2:07 pm
I think we are talking about two different launchers. I actually did this before I made that post so just to make sure we are on the same page:

The original Marziano solution was to:

[Step1] Create the /usr/share/polkit-1/actions/luckybackup.policy file
[Step2] Then to verify that it worked run:

Code: Select all

pkexec /usr/bin/luckybackup
[Step3] Then create a launcher with that same expression: pkexec /usr/bin/luckybackup

What I did was follow Step1 and Step2 then to make it so the original Menu item worked I edited it's launcher by editing: /usr/share/applications/luckybackup-gnome-su.desktop

When you look at the file it was originally set to Exec=su-to-root -X -c /usr/bin/luckybackup
Setting it to pkexec /usr/bin/luckybackup without the Exec= part will make it so the luckyBackup ( super user ) entry in the menu dissapear.

Run the following command to verify for yourself:

Code: Select all

cat /usr/share/applications/luckybackup-gnome-su.desktop
Oooops, you are right! I changed the launcher in the Mate menu, not

Code: Select all

cat /usr/share/applications/luckybackup-gnome-su.desktop
.
Asus Sabertooth X79, i7 3930K CPU, 8x4GB Kingston DDR3, Noctua NH-D14 CPU cooler, GTX 970 + Quadro 2000 GPU, Asus Xonar Essence STX, Sandisk 120GB + Samsung EVO 850 250GB SSD + 4 HDD, Corsair 500R, SeaSonic 660W Gold X PS https://heiko-sieger.info

Post Reply

Return to “MATE”