On 8/31/20 5:07 PM, Vince Winter wrote:
> I am looking for an alternative to gksu/gksudo (they are no longer
> supported) or to pkexec (getting it setup for the gui is annoying, i.e.
> editing policy).
> 
> I am trying to make a cinnamon desktop launch that asks for a password,
> keeping simple as I can to implement.
> 


Depending on what sort of Linux is underneath your Cinnamon DE, and
assuming 'root' has not been disabled, the 'su' for root privileges is
simply:

$ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY <program>

or

$ pkexec --disable-internal-agent env DISPLAY=$DISPLAY
XAUTHORITY=$XAUTHORITY <program>

(depending on your polkit config, both work here) will run <program> as
root after asking for root's password.  This is essentially the same as
opening a console and running "su -"


-Ed




Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
PLUG: https://pdxlinux.org
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to