4

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?

JoeNyland
  • 172
  • 2
  • 9
  • 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 03:29

3 Answers3

4

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.

apaul
  • 3,338
  • 1
  • 15
  • 15
0

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.

eyoung100
  • 5,717
  • 21
  • 50
0

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"];
});
EOL

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

JoeNyland
  • 172
  • 2
  • 9