Logo
IT Dienstleistungen

KDESU works again

Trouble

Some KDE 3.5.x Versions did not work well when trying to use the kdesu command. We had a modified /etc/sudoers in our lab-enviroment, so we had to force the tool, to use the su command instead.

Sollution

~/.kde/share/config/kdesurc

[super-user-command] 
super-user-command=su

Or easier with the tool kwriteconfig

for KDE3

/opt/kde3/bin/kwriteconfig --file kdesurc --group super-user-command --key super-user-command sudo

And here for KDE4:

/usr/bin/kwriteconfig --file kdesurc --group super-user-command --key super-user-command sudo

Now, if you have trouble with X-Server permissions for root, here is how to export the necessary variables. First of all, edit /etc/sudoers with the command visudo (validates the configuration) and allow the environment variables DISPLAY and XAUTHORITY to be forwarded when using sudo, by adding the following line:

Defaults env_keep += "DISPLAY XAUTHORITY"

The second step is to set and export the environment variable XAUTHORITY. The simplest option is to add the following line to your ~/.bashrc or add it to /etc/bash.bashrc.local, the latter being for all users on your host:

[ -n "$DISPLAY" -a -e "$HOME/.Xauthority" ] && export XAUTHORITY="$HOME/.Xauthority"

There you go. Log out and log in again. Then simply do this, as an example:

sudo /sbin/yast2

Seiten-Werkzeuge