replacing “gksu” and cursing those who waste my time

With “gksu” being phased out of Linux distributions and the recommended replacement – “pkexec” – being so fucked up that you need to create a separate XML file in “/usr/share/polkit-1/actions” for each GUI program you want to run as root, it’s time to improvise.

Since security is a joke for distro maintainers, we might as well join the party and use buggy ol’ “sudo” instead, after configuring it to slightly reduce the attack surface. In “/etc/sudoers” add:
Defaults timestamp_timeout = 0
This will force the damn thing to ask for a password each time it’s being run, instead of remembering it for 5 minutes.

Now set a graphical password-asking program in “/etc/sudo.conf” (you might need to install one first – “x11-ssh-askpass” is ugly as hell, “ksshaskpass” and “ssh-askpass-fullscreen” I haven’t tried because I liked “lxqt-openssh-askpass”):
Path askpass /usr/bin/lxqt-openssh-askpass
Now you can use “sudo -A …” to run graphical programs as root:
sudo -A xfce4-terminal --maximize --working-directory /root --tab --working-directory /root

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.