gksu refuses password in kubuntu

Asked by Copernicvs

The problem is that when i try to run a GTK application, the gksu dialog pops up asking for my password to elevate priviliges for the certain app, but even when I input the correct password (works for login and also kdesu dialogs), it says "error, incorrect password, try again". Is there a solution for this?

Kubuntu 11.04
Kernel: 2.6.38-11-generic
gksu: 2.0.2-5ubuntu2

I tried Oneiric too recently, and bumped into the same problem there also.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gksu Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
Last query:
Last reply:
Revision history for this message
arochester (arochester) said :
#1

If it's Kubuntu it's: kdesudo

If it's Ubuntu it's: gksudo

Make sure the cap lock isn't on and that you ate typing in the correct case. Linux is case sensitive.

Revision history for this message
Copernicvs (kornenator) said :
#2

It's Kubuntu, but some programs don't spawn the kdesudo dialog, like Gparted, instead they still open up the gksu, which has the above problem.
I know linux is case-sensitive, and sure as hell i am typing the correct password, since i use that for login every day, and it also works perfectly in terminal for sudo, and also in kdesudo.

Unfortunately the driver HP provides for their printer opens up a GTK frontend, and it also gives me the gksu dialog, instead of kdesudo, and it fails to recognize the password.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Coudl edit the menu item to run:

kdesu gparted

Maybe it will help

Revision history for this message
Copernicvs (kornenator) said :
#4

Thank you Andrew, that works for gparted, but how could i apply this solution for the HP driver binary? That one should be run in terminal with "sh filename.run", then while running it elevates itself in the terminal window by asking for the password, then spawns a GTK windows which again would need the password to run properly.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Add it wherever you wish.

Revision history for this message
Best Eliah Kagan (degeneracypressure) said :
#6

Contrary to widespread belief, gksu *is* the standard way to run graphical programs as root on Ubuntu. gksudo is *not* the standard way to do this, though it is not wrong to use gksudo. If gksu does not work, then it (or something on your system) is broken. gksu works on the majority of Ubuntu systems. If you have not edited your gksu configuration, but it started out wrong, then that is a bug (probably bug 685349).

gksu is a frontend *both* to sudo and to su. When gksu does not work, it is often because it is configured incorrectly, to use su instead of sudo. When gksu doesn't work but gksudo does, that is virtually always the reason. sudo, and not su, is required for elevating privileges to root on a standard installation of Ubuntu (which is the reason for the widespread misconception that gksudo, and not gksu, must be used on Ubuntu).

Press Alt+F2, type in gksu-properties, press enter, and make sure that "Authentication mode" is set to sudo rather than su. If it had been set to su, then this will probably solve your problem. If it was already set to sudo, then please post again and we'll continue troubleshooting this.

For more information about these issues, and to see if you are affected by bug 685349 (and to learn what you can do to indicate that you are affected by it), please see http://askubuntu.com/questions/48215/password-not-working-in-graphical-applications-gksu-works-with-sudo and https://bugs.launchpad.net/ubuntu/+source/gksu/+bug/685349.

If for some reason you wanted to leave gksu in su-mode rather than sudo-mode (while still having your system set up so that sudo, and not su, must be used to elevate privileges to root), then you could probably run your installer with the command "sudo -H sh filename.run" (or even "sudo sh filename.run" since this installer is unlikely to attempt to write or change permissions on user-specific files). And running "gksudo sh filename.run" will probably work too, as actionparsnip suggests, and is arguably better than either of those "sudo" commands. But it is much preferable to simply fix gksu on your system, so it works correctly for all applications that use it (which is many, if not most, graphical tools used for performing administrative tasks, including many official parts of Ubuntu like gparted).

Finally, please note that while gksu is standard on Ubuntu, you *do* need to use kdesudo (not "kdesu") on Kubuntu (or you could use gksu, if the necessary packages are installed for that...but there is no reason to do so).

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#7

To clarify, by "but there is no reason to do so" I mean that there is typically no reason (besides for testing) to manually invoke gksu or gksudo on a Kubuntu system (or a muti desktop environment system while logged in to a Kubuntu/KDE session). Obviously, if you have a program that is already set up to use gksu or gksudo, as in this case, then you have a reason to use that.

Revision history for this message
Copernicvs (kornenator) said :
#8

Thanks Eliah Kagan, that solved my question.

Revision history for this message
Copernicvs (kornenator) said :
#9

Thank you, that was exactly my problem, authentication mode was set to su instead of sudo, now it works like a charm!