Logging In As The Super User

Many newer operating system versions (e.g. Ubuntu 12.04, 12.10) seem to think that we're all children and can't be trusted to do anything as super user. They really go out of their way to prevent you from logging in as super user or running as super user, and spend all of their time nagging you if you do manage to get logged in as super user. As if running commands with sudo is going to prevent you from doing something stupid.

Maybe if the OS actually worked, we wouldn't have to do everything as super user. We could just go about our business without having to tweak things and adjust things, etc., etc. Who are the children anyway?

But, in the meantime, in order to get anything done, you're going to need to be able to log in as the super user. The first step is to set the root password to something you actually know instead of a randomly-generated one, if your version of the OS uses this clever trick to prevent root logins (e.g. Ubuntu).

Login as any one of the users who has sudo prvileges (e.g. the first userid you created when you installed the OS) and do the following:

     sudo passwd root
     (enter the current user's password)
     (enter the new root password twice)

Since it is the graphical user interface (and not the OS itself) that prevents you from logging in as the super user, you simply need to convince the display manager's greeter to let you login as root.

If your OS uses GDM as the display manager (e.g. CentOS or RedHat), edit the file /etc/pam.d/gdm with your favorite text editor:

Find the following line:

     auth required pam_succeed_if.so user != root quiet

Comment it out so that it reads:

     #auth required pam_succeed_if.so user != root quiet

Frequently, the /etc/pam.d/gdm-password file is a symlink to /etc/pam.d/gdm so that no further editing is necessary. However, if it is a separate file, you may have to make the same edit to /etc/pam.d/gdm-password, if the auth required line appears there too.

You will now be able to login to GDM as root the next time around. Click the "Other Users" choice, and enter "root". Then, you can enter the root password and login as usual.

There is more information and an alternate method for logging in as root at the following location:

     http://motorscript.com/enable-root-login-for-linux-systems/

If your OS uses LightDM as the display manager (e.g. later versions of Ubuntu), edit the file /etc/lightdm/lightdm.conf with your favorite text editor:

Add this line to the end of the file:

     greeter-show-manual-login=true

You will now be able to enter the root userid as the userid to log in the next time you reboot the system. Click the "login" choice, and enter "root". Then, you can enter the root password and login as usual.

You can find a more detailed description about logging in as root under LightDM at this location:

     http://handytutorial.com/login-as-root-ubuntu-12-04-12-10/