Login as Root in Ubuntu 12.04 (Precise Pangolin) 26


For new users who just starting with Ubuntu and wanting to know about the root account, here’s a brief post that gives you a little insight about the root account and how / why to use it.  You see, every Ubuntu edition comes with a root account.

The root account is also known as the administrator account. Think of the root account as an account with god-like rights. It can delete any file, any folder and make any change to the system. The power of the root account is limitless.

Because the root account is so powerful, it is automatically created with a password value with no possible encrypted match on the system, which makes it unusable to sign on with. So instead of directly logging on with the root account, users are encouraged to use the sudo command.

The sudo command allows authorized users to temporary elevate their privileges using their own password without knowing the root password or using the root account.

If you still want to enable and logon with the root account for other unknown reasons, simply give it a password. This will enable the root account.

sudo passwd

 

The commands above will enable the root account but to sign on as the root user, you must enable manual logon since it’s now been disabled in Ubuntu. The manual logon option allows for users to type their logon name as well as the password for the account instead of just selecting an account from the logon screen.

To enable manual logon with Ubuntu 13.10, open the config file by running the commands below

 sudo gedit /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf

 

Then add the line below as shown in the image.

greeter-show-manual-login=true

 

ubuntu-root-logon_thumb[1]

 

Save the file and restart your computer.

For earlier versions of Ubuntu, you may find this config file in a different location under /etc/lightdm. It may be called lightdm.conf.

On the logon screen, you can then type the root username with password to sign on.

 

ubuntu-root-logon-1_thumb[1]

 

If you want to lock / disable the root account, run the commands below.

sudo passwd -l root

 

Enjoy!


Please share if you like it on:



Leave a Comment

Your email address will not be published. Required fields are marked *

26 thoughts on “Login as Root in Ubuntu 12.04 (Precise Pangolin)

  • RDB

    I see the Ubuntu forums frown on this, but coming from a GUI OS like Windows how else do they want us to edit files that need fixing?

    My problem occurred when I added a repository in the update manager that caused the Update manager to crash as soon as it opens. So I figured the only way to fix it is to edit /ect/apt/sources.list in a GUI but for this I need ROOT priviliges, which I enabled easily enough but then could not log in the account at the login screen.

    So thanks a lot man..this got me sorted in no time.

  • emerth

    Honestly I think that “Making the smallest mistakes in Ubuntu while login as the root user can completely render your computer inoperable…” is a bit precious.

    A thoughtful person, who reads a few docs or FAQs will not will-he nill-he kill a Linux box dead logged in as root.

    At worst such a person will mess up some subsystem, requiring him/her to read more docs and learn what she/he did wrong.

  • JK

    Agreed, not recommended. ‘Sudo’ is the way to go for elevated permissions. With that being said, how about listing the command(s) to reverse these steps? Thanks!

  • pard33p kumar

    but i have installed many software and packages into my admin account but when i login into root via this procedure then the root account is just like a fresh and newly installed ubuntu, what to do ?

  • Brian

    can you tell me how to reverse or remove this command, please? It didn’t give me root access as suggested, but since I issued this command, I can’t shut down my PC unless I issue the command “sudo poweroff” in terminal.
    Thanks

  • Bharathum

    This really works. At first it was confusing with the user and password that requires, but at last I figured it out. Thanks for the info! more more tricks from you..:D

  • Jean Clement

    I tried the following command for login into ubuntu 13.04
    the fisrt line allowed me to create a password as per your instructions
    The lines of command here— sudo sh -c ‘echo “greeter-show-manual-login=true” >> /etc/lightdm/lightdm.conf’ returns an error message as cannot create /etc/lightdm/lightdm.conf: directory nonexistent.

    Any suggestions? I am stuck with this screen and cannot proceed to the desktop.

  • Rob

    Thanks, This has completely broken my virtual box tothe point I can’tdo anything with it, it’s basically casued a bug with lightDm which keeps bringing me to a “low-graphics mode” screen that I can neither interact with or bypass.

  • pk

    this is good for rendering your shutdown sequence useless. do not execute these commands. there is a reason this person has not responded to the complaints: he is trying to generate complaints, not solutions.

  • Marcin

    Hi,
    I am a Linux novice, and after two days of struggle with my samsung printer drivers I finally got it to work with my Ubuntu.
    Thanks for your help!

  • Wim G

    hello richard
    thanks for your interesting tips
    but: my impression is that you presuppose a lot of knowledge, without realizing that you do so (forgive me if I am wrong).
    Example: (quote from above)

    “If you still want to enable and logon with the root account for other unknown reasons, simply give it a password. This will enable the root account.
    sudo passwd
    The commands above will enable the root account but to sign on as the root user, you must enable manual logon since it’s now been disabled in Ubuntu. The manual logon option allows for users to type their logon name as well as the password for the account instead of just selecting an account from the logon screen.”

    questions that arise in me, reading this:
    a. is “sudo passwd” to be seen as one or more commands?
    b. is “sudo passwd” the command by which you “give it (what?) a password”?
    c quote again: “you must enable manual logon since it’s now been disabled in Ubuntu” what does “now” mean: since typing in the mentioned command(s)? by default? …?

    reading my text I seem to sound like a pest, but I don’t want to be, I just can’t follow you…..
    hope to hear from you!
    kind greetings
    wim

    • Richard W Post author

      a. sudo passwd are two commands.
      b. when you run sudo passwd, it prompts you to create a new password for the root account
      c. after enabling password for the root account, you must also enable manual logon to allow optional login by typing a username and password. Without manual login, only users with listed account will be able to sign on.

      thanks,

  • Muhammad Anisuzzaman

    Hi,
    I’m trying to enable manual logon with Ubuntu 13.04 as root. when I run this – “sudo gedit /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf” – command in terminal, 50-unity-greeter.conf file open with gedit. but when I add this – “greeter-show-manual-login=true” – on the file and try to save the file it says – Could not find the file /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf. What can I do now to solve this problem ?