What is the replacement of kdesudo and gksu in Buster?

Kernels & Hardware, configuring network, installing services

Re: What is the replacement of kdesudo and gksu in Buster?

Postby L_V » 2019-10-16 09:39

Deb-fan wrote: Personally planning to continue using gksu/do for awhile yet.

'gksu' which is a GTK interface to open applications in iKDE5 is probably (I am even sure) not a good suggestion.

Struggling to find a solution to use "sudo" to open a graphical application in KDE5 is a very bad idea.
'sudo' should only/exclusively be used to launch commands or ncurse applications (nano/aptitude etc) in a terminal, but never a graphical application.

For example, Partitionmanager or Gparted which are administration applications can be open without any problem as user, because their policy is managed by policykit.

The good question should not be "how to open as root" a graphical application not declared in policykit, but why do you need it.

Leoncio wrote:In my system if I open a text file I'm not allowed to write, kate will not ask me for a password; it will just refuse to write
You then have something wrong in your installation (clean install ? fresh user profile ? Are you declared as sudoers ?)
-> I do not have any problem in Buster or testing with KDE5, and never need to open any graphical apps as root.
L_V
 
Posts: 1125
Joined: 2007-03-19 09:04

Re: What is the replacement of kdesudo and gksu in Buster?

Postby Deb-fan » 2019-10-16 09:52

Yeah I know but still mainly seems silly to me overall. Someone with root/sudo privileges can do whatever they wish to a given system, polkit, policy file or no. Needless to say, I do want a convenient and straight-forward means to launch graphical apps-etc with elevated privs. That's just my views on this topic. :)
Deb-fan
 
Posts: 445
Joined: 2012-08-14 12:27

Re: What is the replacement of kdesudo and gksu in Buster?

Postby wizard10000 » 2019-10-16 09:52

L_V wrote:Struggling to find a solution to use "sudo" to open a graphical application in KDE5 is a very bad idea.
'sudo' should only/exclusively be used to launch commands or ncurse applications (nano/aptitude etc) in a terminal, but never a graphical application.


You can use sudo -i or sudo -H to launch a graphical application.

As far as using gksu in KDE there's no technical reason not to - GTK+ and Qt are just graphics toolkits.
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 99
Joined: 2019-04-16 23:15
Location: southeastern us

Re: What is the replacement of kdesudo and gksu in Buster?

Postby L_V » 2019-10-16 10:03

wizard10000 wrote:[You can use sudo -i or sudo -H to launch a graphical application.
Your view / I don't agree and will never do it (since Buster).
If you want to force the system, you can create a clean policykit rule instead of conflicting the system rules.
My rule is simply:
sudo => commands + ncurse apps in a terminal.
policykit for graphical apps.
Looks strange I do not have any issue with this rule.
L_V
 
Posts: 1125
Joined: 2007-03-19 09:04

Re: What is the replacement of kdesudo and gksu in Buster?

Postby wizard10000 » 2019-10-16 10:22

L_V wrote:If you want to force the system, you can create a clean policykit rule instead of conflicting the system rules.


Or, since it's my system I can configure it however I choose :)

I think we should agree to disagree. One really great thing about Linux is choices :)
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 99
Joined: 2019-04-16 23:15
Location: southeastern us

Re: What is the replacement of kdesudo and gksu in Buster?

Postby L_V » 2019-10-16 10:26

wizard10000 wrote:I think we should agree to disagree.
I fully agree.
L_V
 
Posts: 1125
Joined: 2007-03-19 09:04

Re: What is the replacement of kdesudo and gksu in Buster?

Postby CwF » 2019-10-16 15:40

It seems the fancier the DE the worse the issue?

Here's my annotated list for xfce buster:
Code: Select all
user@buster:~$  ls /usr/share/polkit-1/actions
com.ubuntu.pkexec.gdebi-gtk.policy       cl=pkexec gdebi-gtk
com.ubuntu.pkexec.synaptic.policy      cl=synaptic-pkexec
org.bleachbit.policy                    cl=pkexec bleachbit
org.dpkg.pkexec.update-alternatives.policy
org.freedesktop.DisplayManager.AccountsService.policy
org.freedesktop.hostname1.policy
org.freedesktop.locale1.policy
org.freedesktop.login1.policy
org.freedesktop.pkexec.usbview.policy        cl=pkexec usbview
org.freedesktop.policykit.policy
org.freedesktop.RealtimeKit1.policy
org.freedesktop.resolve1.policy
org.freedesktop.systemd1.policy
org.freedesktop.timedate1.policy
org.freedesktop.UDisks2.policy
org.gnome.gparted.policy                 cl=gparted-pkexec
org.gtk.vfs.file-operations.policy
org.xfce.power.policy
org.xfce.session.policy
org.xfce.thunar.policy                    cl=pkexec thunar /path
org.xfce.xfce4-terminal.policy         cl=pkexec xfce4-terminal
org.x.xf86-video-intel.backlight-helper.policy

Perhaps I would use a root thunar to place /usr/share/pixmaps/gksu-root-terminal.png, I like it.

gdebi, usbview, and up until recently bleachbit as root may use older methods for the command line, expect that to change. The policy file still affects the authority.

spacefm may have an option soon.

In all of the above files 'auth_admin' can also be 'no'
for "I have the ******* keyboard" authority;
Code: Select all
      <allow_active>yes</allow_active>

And to make it easy, navigate to this directory with a root thunar, click to open any of the files in mousepad with inherited permissions, edit the allow_active to yes, and get on with your life.
CwF
 
Posts: 499
Joined: 2018-06-20 15:16

Re: What is the replacement of kdesudo and gksu in Buster?

Postby Head_on_a_Stick » 2019-10-16 17:18

Leoncio wrote:How can that be used to run gparted, gsmartcontrol, synaptic, thunar and others?

Gparted already uses polkit in buster (and will run under Wayland) and synaptic will be fixed soon[1] — gnome-software works fine now and is better than synaptic anyway.

In respect of file managers I think you may be SOL. Isn't the future wonderful? :mrgreen:

Also:
Leoncio wrote:computers (and machines in general) must adapt to humans, not the other way round

I don't understand.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10599
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: What is the replacement of kdesudo and gksu in Buster?

Postby Leoncio » 2019-10-16 21:59

Head_on_a_Stick wrote:In respect of file managers I think you may be SOL. Isn't the future wonderful? :mrgreen:

In respect to Debian, if it continues like this, users will start to move to other distros. Isn't the future wonderful? :mrgreen:

Old-school Linux users and developers, that are elitist by nature, will really love it, for sure (no sarcasm here).

Time ago, I had Ubuntu and I moved to Debian because I was fed up with some things of Ubuntu. Till now I was really happy with the change; a smart move. Now, let's see how Debian evolves from now on, but I smell that the old-school developers, strongly elitists, are in control. Maybe it is time to find another distro (not Ubuntu, I had enough with it). Maybe I am not the only one. But let's see how it evolves.

Head_on_a_Stick wrote:Also:
Leoncio wrote:computers (and machines in general) must adapt to humans, not the other way round

I don't understand.

Ha ha ha!!! :D :D :D
Leoncio
 
Posts: 33
Joined: 2012-01-07 18:14

Re: What is the replacement of kdesudo and gksu in Buster?

Postby sunrat » 2019-10-16 22:20

Every day there is a post where someone wants ${something} changed or else they will move to another distro. And every day the world's tiniest violin plays.

I've been using Debian for ~14 years. There have been many changes for security, visual, workflow, or sometimes unfathomable reasons. I sometimes lament the passing of old ways but there are always new ways which can be easily learnt.

The answer to the topic is the replacement of kdesudo and gksu is most commonly policykit but pkexec files have not been included for all software. Your mission, if you choose to accept it, is to learn to write pkexec rules for applications you need them for and share them with the world.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2868
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: What is the replacement of kdesudo and gksu in Buster?

Postby CwF » 2019-10-16 22:31

sunrat wrote: write pkexec rules for applications you need them for and share them with the world.

I tried, guess nobody was paying attention...

It's not a debian issue at all, so swapping distro's won't help. In this particular thread the culprit is kde. A DE does not a distro make.
CwF
 
Posts: 499
Joined: 2018-06-20 15:16

Re: What is the replacement of kdesudo and gksu in Buster?

Postby Leoncio » 2019-10-16 22:41

sunrat wrote:The answer to the topic is the replacement of kdesudo and gksu is most commonly policykit but pkexec files have not been included for all software. Your mission, if you choose to accept it, is to learn to write pkexec rules for applications you need them for and share them with the world.

Good point indeed!! :) But I have not time. The day has only 24 hours. By the way, does anybody know who was the idiot that made the days with only 24 hours? :mrgreen:
Leoncio
 
Posts: 33
Joined: 2012-01-07 18:14

Re: What is the replacement of kdesudo and gksu in Buster?

Postby sunrat » 2019-10-16 22:44

CwF wrote:
sunrat wrote: write pkexec rules for applications you need them for and share them with the world.

I tried, guess nobody was paying attention...

I tried a couple too, one worked and another didn't. Which is one of the points I was making - I found a different way to accomplish the same task, different software IIRC maybe even CLI :o .

It's not a debian issue at all, so swapping distro's won't help. In this particular thread the culprit is kde. A DE does not a distro make.

policykit is not KDE specific. There have been posts about other DEs changing their authority protocols.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2868
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: What is the replacement of kdesudo and gksu in Buster?

Postby Leoncio » 2019-10-16 22:52

It looks that running graphical programs with sudo poses a security hazard so, this workaround is not good, but IMO the worst of the worst is to rely on deprecated packages like kdesudo and gksu that are not maintained anymore. We have synaptic using kdesudo and who knows how many more are using gksu or kdesudo.

Here is a tiny script as a (bad) workaround to the problem:
Code: Select all
#!/bin/bash

export SUDO_ASKPASS=/usr/bin/ssh-askpass
sudo -A $1


I have named it xsudo.sh. But you can name it whatever you want, for example:
script_to_replace_kdesudo_because_Buster_was_released_without_a_replacement.sh :(
Short and easy-to-remember names like this one are the best ones, right? :wink:

After changing its ownership to root and giving it execution permission copy it to /usr/local/bin
Remove the kdesudo and gksu packages.
Make these symlinks:
Code: Select all
ln -s /usr/local/bin/xsudo.sh /usr/local/bin/kdesudo
ln -s /usr/local/bin/xsudo.sh /usr/local/bin/gksudo
ln -s /usr/local/bin/xsudo.sh /usr/local/bin/gksu
ln -s /usr/local/bin/xsudo.sh /usr/local/bin/xsudo

The last symlink is for convenience, or you could name the script xsudo in the first place.

Again: This is not good but using not maintained any more programs like kdesudo and gksu is worse IMO.

And again: a new STABLE version of Debian should NOT have been released having synaptic and who knows how many more programs relying on outdated and not maintained anymore programs like gksu and kdesudo. We users of the stable version accept the drawbacks of using a bit outdated programs in the Stable version because we expect a polished version of Debian without the small problems of Testing and Sid. :evil:
Leoncio
 
Posts: 33
Joined: 2012-01-07 18:14

Re: What is the replacement of kdesudo and gksu in Buster?

Postby Deb-fan » 2019-10-17 01:45

Not to come off as overly harsh but as an end-user, unless a very active developer or contributor has zero rightful say in what/when Debian does or releases. Agreed with this situation being an inconvenience though it's also reasonable that people be expected to learn and find work around's for whatever it is they wish open source software to do for them. Anyone would have to acknowledge all the efforts (for decades) Debian + others have contributed to the open source movement or revolution or whatever.

Yeah switching to another distro may in fact help you out in your situation. That being one whose maintainers have already addressed this issue to whichever extent. Already include polkit/policy files for you OR spend a little time and learn what you need to do, to get Debian gnu/Linux to do what you prefer it to do. Almost never had any problems launching graphical apps with the appropriate use of sudo and was always easy to sort it out with chown. If file ownership issues cropped up.(Even when was more newbish. Which was user error through ignorance at the time.)

Mentioned am planning on continued use of the gksu/do packages in Buster (or lxqt-sudo). Thanks Wizard10000 for confirming it'll work. I'm still using Stretch at the moment here. Personally will also continue using Xorg instead of Wayland for awhile. There's always a solution or more like MANY solutions when dealing with gnu/Linux. Am sure these changes aren't being implemented for no reason(s) too. This development is no exception.
Deb-fan
 
Posts: 445
Joined: 2012-08-14 12:27

PreviousNext

Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable