Wednesday 22 August 2018

The end of the line for gksu?

It was only recently that I upgraded my Lubuntu laptop to 18.04, and then found that some of my .desktop launchers had stopped working.


Many Linux distros have now decided to drop gksu as they feel it is unsafe to launch GUI apps as Root.


Well whoopy-do!  Safe or unsafe, I still want to do it.


gksu is a command that a Linux user can use to launch a graphical application with root privileges. This is considered unsafe, but life is not without its risks. I can understand it being dropped from Linux distros like 'buntu as part of a standard install, but I don't know why they can't leave it in the repository for crazy people like me to install. I'm a big boy, I can take care of myself!


I won't waste any time trying to defend my reasons for using gksu, I'm an idiot, OK?

But here are a couple of ways to get around the problem, at least until something better shows up.

using sudo


Previously, if I wanted to run a program like Gambas as root I would have created a launcher like this:-

[Desktop Entry]
Name=Gambas3 as Root
Comment=Gambas3 Integrated Development Environment
Keywords=Gambas3
Exec=gksu gambas3
Type=Application
Icon=gambas3
Terminal=false
Categories=Development;

When this launcher runs with gksu installed, you are presented with a nice GUI password box.


This no longer works on Lubuntu 18.04, but I can modify the launcher EXEC and TERMINAL lines like this:-

[Desktop Entry]
Name=Gambas3 As Root
Comment=Gambas3 Integrated Development Environment
Keywords=Gambas3
Exec=sudo gambas3
Type=Application
Icon=gambas3
Terminal=true
Categories=Development;

This gives me a terminal window which prompts for a password. After entering the password, Gambas will run as root, but the terminal window must be left open.

I can't imagine the risks using sudo differ greatly from using gksu, but its for you to assess.

using pkexec


This may be another option, but I can't find the enthusiasm to spend time looking at it.

the nuclear option


You could edit the sudoers file an make your self all-powerful. This may be my next step if they make things any more difficult.

No comments:

Post a Comment