How to Enable root Login from kdm Login Manager
Last updated 2007-05-23

I've been testing Mandriva's newest offering, 2007 PowerPack, on a spare computer I've got gathering dust in the bedroom.  I've noticed recently there's a tendency toward nannyism in some of the distros.  I found that Debian, Freespire and Mandriva don't want to allow graphical root logins.  Further, as silly as this is, there is no simple way to fix that (for those of us who may need to work that way).

Digging around, I figured out (at least in Mandriva) how to kill that.  It only happens when kdm is used for the login process.  I found that when I set the login screen to be controlled by "xdm," I can login root just fine, it's just kdm that blocks it.  Here's how to fix it (at least in Mandriva):
  • Open a text editor (kwrite or whatever your favorite is) in root mode.  If you don't have an icon for that, go to the main KDE menu button (usually at the far left end of the task bar) and select "Run Command" or equivalent.  Type the name of the text editor you want to use in the "Command" box, then click the "Options" button.  Select "Run as a different user" and type "root" into the Username box.  Type the root password into the Password box and click "Run."
  • When the text editor appears, open the file, "/etc/kde/kdm/kdmrc" and search for the line for the command, "AllowRootLogin."
  • Change "false" to "true" and save.
  • Just logging out should be enough for the changes to take place, but if it doesn't you may have to restart the X server (ctrl-alt-backspace) or reboot.  I rebooted just to save kaka and time.
  • You will now be permitted to login as root.

I notice that on SUSE 10.1, where I can login as root, this file is located in /opt/kde3/share/config/kdm.  I also notice that the AllowRootLogin parameter is set as false (KDE's own default setting), which makes me wonder if SUSE is using some kind of proprietary login manager instead of kdm.  Update: SUSE does use its own proprietary login manager.  Since it allows root logins by default, there's no reason to mess with it (and I haven't been able to figure out how anyway!).

If for some reason, such as the OS was installed without a user account where you could get to this file, you should still be able to log on in in shell/text mode and correct the problem with vi.  That, of course, assumes you know more about Linux/Unix than the average user.

Also, please note that I only tried this on Mandriva 2007.  While this will probably work on other distros, I cannot confirm that here.

Update: I've figured out how to do this in Kubuntu (7.04 "feisty fawn").  Here's the surgical procedure:
  • First, you must be an admin user.
  • Assuming you are, select "Run Command" from the KDE menu (where the Windows "Start" button would be).  In the dialog box that appears, type "kwrite," then click the "Options" button and select the "Run as a different user" box.  Type "root" in the first box that ungreys, then type your password in the second box.  Click "Run."
  • Open file "/etc/kde3/kdm/kdmrc" and search (find) "AllowRootLogin."  Change "false" to true" and save the file.  KDE will now permit you to try to log in as root.  Do not stop here, you are not finished.
  • Now, open "System Settings," click on "Administrator Mode," type your user password in the box that appears, and click on "User Management."  Look for the box labeled "show system accounts" and find "root."  Select it and click the "Modify" button.  Under the Details tab, click Status "Enabled."  Under the "Password and Security" tab, type in a new root password.  Click OK and exit the Settings program.  You can now log in as root.
I have Kubuntu installed on a couple of computers here and the only annoying problem I have is they won't shut down automagically, like the newer computers will.  Here's what you can do to fix that:
  • Using your favorite text editor (mine is Kwrite), open the editor in root mode, browse to /boot/grub and open menu.lst.
  • Scroll down to the default boot line (following "## ## End Default Options ##") and adding "acpi=force" to the end of the "kernel" line.
  • Reboot and test by performing a full shutdown.
If it still won't shut down properly, chances are that thing is either so defective it shouldn't be trusted to the most menial tasks or it's so old it's straining to run Linux at all.  In either case, I recommend immediate recycle and go out and buy something that'll actually run fast enough to be useful.

Joe



Return

Copyright © 2006 - 20012 Joseph B. Short - All Rights Reserved  Document made with KompoZer