3

Apparently gksudo is not obeying /etc/sudoers, neither does kdesu.

Therefore asking the other way around...

Is there any su-to-root, gksudo, kdesudo, etc. alike tool, that supports starting gui applications as root or different user with an option to skip entering a password?

adrelanos
  • 1,836
  • 7
  • 30
  • 58

2 Answers2

5

The point of a “graphical sudo” is to prompt for the user's password. If you don't want a password prompt, use plain sudo.

Run visudo to create an entry in the sudoers file with the NOPASSWD tag. Note that this entry must come after any ALL entry.

Make sure that the DISPLAY and XAUTHORITY environment variables are preserved, to allow running X11 applications.

adrelanos ALL = (ALL) ALL
adrelanos ALL = (root) NOPASSWD: my-x11-application-to-run-as-root
Defaults env_keep += "DISPLAY HOME XAUTHORITY"
1

You can use SSH with X forwarding (-X) and a key without password.

SSH has the useful feature that keys can be limited to one command. This could be a kind of sudo replacement: Prevent the user from doing as root what he wants; limit him to what he must be capable of doing.

Hauke Laging
  • 90,279