You are not logged in.
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
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.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
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
@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
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