On one of my systems, I'm running Gentoo Linux and I've installed x11-libs/gksu-2.0.2-r1. I've disabled the root account using sudo passwd -dl root and I want to be able to run GUI apps which need root privileges using sudo.

I've set gksu to use sudo for authentication using gksu-properties, but it's still asking me for root password when I launch an application that needs root privileges and not mine.

What am I missing?

  • 1
    gksu is also a Gtk+ frontend to su. Looks like it is trying to run the su program. – dr_ Apr 23 '15 at 14:48
  • @dr01 I'm telling gksu to use sudo for authentication, not su (see second paragraph of my question) – JoeNyland Apr 23 '15 at 15:22
  • @MasterRoot24 you haven't set targetpw in sudoers, by any chance, have you? – muru Apr 24 '15 at 3:29

gksu acts like su, not sudo. That's why it asks you root password.

Try to run gksudo instead if available. If not, you can run gksu --sudo-mode.

Also, from the man page:

Also notice that the library will decide if it should use su or sudo as backend using the /apps/gksu/sudo-mode gconf key, if you call the gksu command. You can force the backend by using the gksudo command, or by using the --sudo-mode and --su-mode options.

| improve this answer | |
  • If /apps/gksu/sudo-mode is set to true, then gksu works like sudo and not su – JoeNyland Apr 24 '15 at 13:33

You're on the right track, just the wrong command. Try:

  1. Enable sudo by installing app-admin/sudo....Done
  2. Configure sudo using visudo. Set the appropriate options .... Hopefully Done
  3. Use gksudo app-name instead of gksu app-name.

In gentoo, gksudo is part of the package x11-libs/gksu, and the actual man page is at gksudo man page. As always make sure the gnome USE Flag is set.

| improve this answer | |
  • Yeah, I've already installed sudo - see the first part of my question... – JoeNyland Apr 24 '15 at 13:32

Ok, I worked out that even though I was setting gksu to use sudo for authentication, this was all irrelevant as the shortcuts that I was using in the Xfce menu were starting applications using polkit and not gksu.

From the Gentoo Wiki on polkit, I did:

sudo bash -c "cat > /etc/polkit-1/rules.d/10-admin.rules" <<EOL
polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];

...and this let me start applications which needed root privileges by entering my password in sudo-style fashion.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.