Ubuntu Linux does not allow root user to login with Login manager. Root account is present, but locked. Ubuntu forums refuses support related to enabling root login. Good way to go. For the sole purpose of this educational walkthrough, I installed Ubuntu 10.04(Lucid Lynx) and Kubuntu 10.10(Maverick Meerkat) on separate partitions. The user was conveniently named “username”. Let us see how to login as root through KDM and GDM login manager in Ubuntu linux.
Okay, First things first. Root(Superuser or Administrator) login in linux is really not a good idea. Yes, there is always a chance of messing up system files, not to forget compromising the integrity and security, that are the trademark features of Linux OS. If you are paranoid about system security, then this is not for you.
Unlocking root account in Ubuntu
First thing to do would be to unlock the root account.
Open the terminal. (Applications – > Accessories –> Terminal in Gnome, KDE Kicker start menu –> type konsole and enter).
Issue the following command.
username@ubuntu :~$ sudo passwd root [sudo] password for username: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully username@ubuntu:~$
Superuser – root now have a new password. Now remember – With great powers comes great responsibilities. And let’s proceed.
GUI root login through prompt
Both GDM (Gnome display manager) and KDM (KDE display Manager) does not include root in the User list.
A viable Workaround is to modify its configuration files. First – we need to know the location of the configuration files and second – Backup them.
Root login with GDM – Gnome login manager
In the GDM login screen, click “Other”. In the username field that follows, enter root. Input your password in the next field and login. That should do it. Yep, no need to edit the files. Skip to next section.
But for some reason it doesn’t work, then proceed through below steps. Otherwise Skip to the next section.
A text based file “custom.conf” allows us convenient GDM configuration and is not overwritten with Gnome/GDM updates. let’s modify this file located in /etc/gdm/custom.conf.
Open your favorite text editor with root privileges(using sudo). For example, let’s open a GUI editor such as gedit using sudo(in terminal) or gksudo(in a run box). You will be asked to enter your password for the first time on the current session.
#example gksudo gedit /etc/gdm/custom.conf
The file starts with the string [daemon]. If you find the file empty at open, then make sure you add [daemon] at the beginning.
Add “AllowRoot=true” to the end of the file.
Now save and close the file. (If you have trouble saving the file, cough** sudo ** cough).
Now log out. In GDM greeter, click other to get username and password prompt and login as root. Take a look , but be careful though.
Making audio work when logged in as root in Ubuntu
aka Fixing “Waiting for sound system to respond” error.
By now, you could have probably figured out audio is not working. We didn’t hear the login sound, right? Clicking “Audio icon –> Sound preferences” does not help, only following message “Waiting for sound system to respond” appears. Ugh.. let’s fix that.
Sound is powered by pulseaudio daemon, which does not run under root user.
- On the Menu bar, click “System-> Preferences-> Startup Applications”.
- On the window that appears now, Click Add.
- Enter the name as “Fix Audio”.
- Under the command, enter “/usr/bin/pulseaudio” (without quotes). Comment is optional.
- Finally click Add. Then click Close.
Now log out and in. Now it should be working.
Even more craziness
Following lines when added to custom.conf will make the root user auto login!!!
Holy shmoly. Ok, let me stop now.
Root login with KDM login manager
When you try to login as root in kubuntu, KDM pops up an error. Oops!
KDM’s configuration file is located in /etc/kde4/kdm/kdmrc.
Open the text editor with root privileges using sudo. Open terminal and type sudo kate.
username@ubuntu:~$ sudo kate /etc/kde4/kdm/kdmrc [sudo] password for username:
Kate opens the file. Now look for a line that says “AllowRootLogin=false”. Change it to “AllowRootLogin=true” . Self explanatory.
Please save and close the file, Log out. Now you should be able to login as root through kdm login manager.
Note
Wondering Why write this post, if its very dangerous? Well, This tutorial is for educational purposes only. More than over thousands experienced linux gurus can’t be kidding, right?
Playing around with root account is very dangerous unless you know what you are doing. If you are running X server as root, your are compromising the security. Please do not perform this procedure on any system with sensitive information.
Sudo takes care of most of the situations that require root. Then there is command “su”.
Your windows machine may list your username as an “Administrator”. But don’t be fooled, windows administrator in no way can be compared to Linux root. It is like comparing Jar Jar with Superman. Enough said.
Thanks for reading,
Kavin Gray