Configuring Kubuntu For Root Logons

Kubuntu Linux has the root account disabled by default for security purposes. Users are encouraged to use the sudo command as an alternative whenever root-level priviledges are needed.

Now, maybe I’m too old-skool, but that’s just plain irritating. Here’s how to enable root logons in Kubuntu.

Edit the kdmrc file

The first thing you need to do to enable root logons in Kubuntu is to modify the /etc/kde3/kdm/kdmrc file. However, to change this file – guess what? – you need root access! Here’s how to do it:

  1. Press alt+F2 to call up the Run Command. Type in /etc/kde3/kdm to call up the kdm folder in Konqueror.
  2. When the folder opens, you should see a file called kdmrc. Right-click it and select Actions, Edit As Root. You’ll be prompted for the root password (which should be your own password)
  3. The file should open up in a text editor (KWrite on my installation). Broswe for the line AllowRootLogin=false and change false to true. Save the file and close it.

Enabling Root Logins (Modifying the Root User Account)

The second step here is to actually enable the root account for login, because it is disabled by default. There may be a quicker, more linux way to do this, but this is my method:

  1. Press alt+F2 to call up the Run Command. Type in kuser to start up the KDE User Manager.
  2. Double-click on the root entry to bring up the account properties and uncheck the Account Disabled checkbox. Click OK to save the changes.
  3. Exit the KDE User Manager.

And that’s it! If you log off, you should now be able to login to Kubuntu as root.

Why Enable Root Logins?

Yes, I know that in an ideal world I would use sudo. Why did I absolutely require root access? Well…

  1. I don’t know Linux very well. I can hold my own, but I don’t speak the command-line-lingo like the pros.
  2. Elements of the GUI in Kubuntu don’t work so well. In particular, the network configuration utility ‘forgets’ the default gateway entry.
  3. Some graphical tools also have an Administrator Mode button. I found in some instances that this didn’t work. You would type in credentials and it would return you to the same greyed-out screen, indicating that authentication had been rejected. Very frustrating.
  4. Being fairly unfamiliar with Linux, I didn’t know the command equivalent for these graphical functions, so I couldn’t very well sudo them, could I?

If anybody reading this has any links to good newbie linux resources, let me know!!!

7 thoughts on “Configuring Kubuntu For Root Logons

  1. Jannos

    Hi. Thank you for finding the time to post this guide for enabling the root logins but in 8.10 this is not working because you must be root to edit the “kdmrc” file and there is no “actions menu” and “edit as root”.

    So I tried a different way and this is it:
    If you don’t have mc (midnight commander) installed in your system install it with Adept installer now.
    Then open a terminal and type “su”.
    Give the password and type “mc”.
    A blue screen will come up and you must search for “/etc/ ”
    double click it and find “/kde4/” then find “/kdm/ ” and then “ /kdmrc/ ”.

    Open the file with F4 to edit it and Browse for the line Allow Root Login=false and change false to true.

    To exit press ctrl + alt + x .Type “y” , press enter and leave the file name without any change.

    Thats it!

    I am sure that there must be a better way to do this but this will do the job.

    Best regards. Jannos

    1. gerard

      I’m still learning Jannos, but if I were doing this same thing today I’d do it from the command line and use a combination of sudo (for elevated privileges) and vi (to edit the text file).
      Something like: sudo vi /etc/kde4/kdm/kdmrc
      That will prompt for your password, then you can edit the file accordingly. Let me know if you need more help with this.

  2. Bill

    Hello… VI is a horrible excuse for an editor (well every oldtimer will tell you how powerful it is… but I AM an oldtimer and I HATE VI) For at least the last hundred years or so (before KDE and Gnome for sure)… I have always installed a simple, but easy to use command line editor called pico… picois installed with the Pine (now Alpine) email reader. I am looking at my Kubuntu 8.10 right now, and it was already installed. Go into your terminal su to root  go into /etc/kde4/kdm  pico kdmrcUse CTRL-W and type in allowrootloginchange false to trueCTRL-X to exit, it will ask you if you want to save changesViola Hope that helps

    1. gerard

      Bill – thanks for your input! You put a smile on my face with that comment about pico – I did a Unix course once for work, and the guy taught us to use VI, and I’ve used VI in a command line environment ever since. Failing that, I’ll use whatever GUI based editor is bundled with linux – KWrite or Kate.But that’s the beauty of *nix – so many tools to suit your needs.

  3. Bill

    That’s probably the reason I never liked VI, I am a self taught *nix-er…. I can get around the basics, but can’t get into the deep macro stuff or anything. Plus, when I want an editor, I just want it to…edit, I want to get in and out 🙂 Now, thank YOU for giving me the insite on how to activate the root user in this stupid kubuntu system. I like the OS cause it’s light on resources (though 8.10 is a little more bloated than 8.04).. I have CentOS on my main computer and I can root that anytime. In my opinion there is an inherant FLAW in the ubuntu theory about not allowing you to login as root. Their theory is that by not allowing you to log in as root, there is less chance of causing damage to your system. Which of course is fine…in theory. The user has to su or sudo every time he wants to do a system command, which MAY make the user think twice about running it. However anyone maliciously wanting to gain root to your system has it easy if they managed to compromise your user account… because the root password is THE SAME as your first users password!  What’s the main point in that? TIP for anyone enabling root (or for that matter leaving it disabled) is to go into the User Manager in Apps/System under the menu or ALT-F2 Kuser and edit root to change the password… this DOES mean memorizing another password… but it’s worth it for security purposes to have the password differ than the PW of a regular user, especially since anyone wanting to cause you harm knows the ubuntu theory.Also if enabling root, it might be worth going into System Settings and the Login Manager…. select the Users tab it will bring up a list of users to exclude from the Login Window… click on root. It will not disable it, it will make it just not show up as an option. You’ll still be able to type it in the box as a username. Just a little trick that might add a little illusion of security Sorry, the post is a little longer than I expected, please accept my apology 🙂

  4. Brian

    For what $0.02 it’s worth.    I found a satisfactory solution elsewhere on the net. ( ) As mentioned above, 8.10 doesn’t have the "actions menu" and "edit as root". So I looked for a simpler solution. Not being an "old skool" *nix anything, I prefer an editor with a GUI. I’m not ‘endorsing’ any particular one, but the solution I found uses Kate, so that’s what I’m copying here. I tried this two ways, first was to open a terminal, then copy and paste the following sudo from there. After the sudo it asked me for my password and everything else was as described. The second time, (mostly out of curiosity), I tried the same sudo from the Alt-F2 run command. I expected that to prompt me for my password. To my surprise it didn’t. Then again, I’d just used the sudo a moment ago in the terminal, so it might have "remembered" my password from that. I don’t know. So this way may or may not work for others. I only mention it because it might be easier for some people to hit ALT-F2 than to get a terminal window open. In either case, in 8.10, here is what I found that worked fine for me: sudo kate /etc/kde4/kdm/kdmrcclick the find button, enter "AllowRootLogin" change the value to "true" save, logout, log back in as ROOT!Before closing, I’d like to thank Gerard for the great post on this topic. His explaination allowed me to actually UNDERSTAND things, whereas the place where I found the above, simply told what to do without really sheding any light on WHY. I only add my $0.02 worth here because in 8.10 you can’t get to kdmrc the way he describes. THANKS GERARD!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s