You are not logged in.

#1 2019-07-13 18:29:04

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,842
Website

Gksu simulation in pkexec era

https://raw.githubusercontent.com/bront … r/bin/gksi

Install:
- Copy to $PATH (like ~/bin)
- chmod +x gksi

Usage example:

cd /etc/apt
gksi geany sources.list

Note: There are possible unknown security implications or dangerous unknown bugs, especially since this is dealing with root. Review from smarter people would be nice (It's a small script).

Last edited by brontosaurusrex (2019-07-13 18:37:52)

Offline

#2 2019-07-14 03:16:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,850
Website

Re: Gksu simulation in pkexec era

Yes 'pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" ...command' seems to work OK, although it might not be approved of by security experts...

But, in fact, if the goal is to edit some text files as root, BunsenLabs already ships a policy file for bl-text-editor (which can be geany or any other editor you want) and bl-cli-text-editor (which runs vim or nano in x-terminal-emulator), so you can just do:
'pkexec bl-text-editor file [file]...'

If that doesn't work, please report back - it would be a bug.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#3 2019-07-14 04:03:26

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 741

Re: Gksu simulation in pkexec era

Running X apps as root is not really a good idea but doing it in a secure manner that does not open a nasty can of security worms can be a useful way of getting things done as root using GUI's.

This little script is good for your own machines but certainly may be frowned upon in a business environment...

Last edited by DeepDayze (2019-07-14 04:04:28)


Real Men Use Linux

Offline

#4 2019-07-14 07:56:56

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,842
Website

Re: Gksu simulation in pkexec era

@johnraff; Main idea was to expand paths to full path, for example

cd /etc/apt
pkexec geany sources.list

is not working on this pure-Debian machine  (Due to geany not knowing it's in /etc/apt).

@DeepDayze: Noted, what is the unfrowned method?

edit: How about edit a copy as user and then replacing as su after the fact?

Last edited by brontosaurusrex (2019-07-14 11:48:16)

Offline

#5 2019-07-26 12:50:16

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 1,019

Re: Gksu simulation in pkexec era

Not sure if should post this babble here but seemed appropriate or I missed the point. Was discussing similar and the thread has at least a couple actively maintained alternatives to gksu/do. Someone really wants to stay stuck in their ways could even alias it.

Ie: alias gksu="lxqt-sudo"

Offline

Board footer

Powered by FluxBB