Login as Root in Ubuntu 12.04 (Precise Pangolin)

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!

Comments

  1. Deoye - February 11, 2013 @ 9:41 AM

    Thanks

  2. RDB - February 17, 2013 @ 12:23 AM

    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.

    • Chris - August 3, 2013 @ 5:43 PM

      You don’t need to login to root to do that. You can execute any program as root with sudo.

      • phoebus - October 9, 2013 @ 2:29 PM

        some want to go deeper than meets the usereye

  3. Antoine - March 27, 2013 @ 8:50 AM

    Thank you.

  4. SHISHA - March 28, 2013 @ 6:14 AM

    Thank you very much!

  5. Sreekanth - April 3, 2013 @ 6:20 AM

    Thank You…:)

  6. emerth - April 3, 2013 @ 2:24 PM

    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.

  7. JK - April 9, 2013 @ 10:41 PM

    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!

  8. techmd - April 14, 2013 @ 2:25 PM

    Really helpful and easy to follow guide. Thank you so much, you got me out of a bind!

  9. pard33p kumar - April 15, 2013 @ 3:18 PM

    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 ?

  10. Bharathkumar - April 20, 2013 @ 2:14 PM

    That Really worked ……….:-)

  11. Brian - April 23, 2013 @ 4:31 AM

    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

  12. Bharathum - May 17, 2013 @ 3:36 AM

    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

  13. Muhammd Tahir - May 23, 2013 @ 3:54 PM

    thanks :-)

  14. Jean Clement - June 2, 2013 @ 3:45 PM

    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.

  15. Rob - June 28, 2013 @ 10:12 AM

    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.

  16. Brijesh Rawat - August 28, 2013 @ 7:33 AM

    I have tried the same bu it is not showing me the “Username” option but “Password” only

  17. pk - September 24, 2013 @ 10:45 AM

    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.

  18. talmus - October 14, 2013 @ 1:29 PM

    great!!!!!!
    thank you very much

  19. Marcin - November 10, 2013 @ 2:24 PM

    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!

  20. Ajay - November 16, 2013 @ 10:05 AM

    Thanks for this…

  21. anoymus - December 2, 2013 @ 12:08 AM

    Could not find the file /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf.
    Please check that you typed the location correctly and try again.

  22. Wim G - February 13, 2014 @ 10:05 AM

    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 - February 13, 2014 @ 10:28 AM

      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,

  23. Muhammad Anisuzzaman - March 10, 2014 @ 6:50 AM

    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 ?

  24. Amir - September 8, 2014 @ 2:27 PM

    sudo -s
    After typing in terminal
    provide your current user password
    # sign will be shown instead of $ for root user

  25. Ashish - March 22, 2015 @ 3:42 AM

    Thanks :)

Leave a Reply

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