I ran this commands in Terminal and I didnt get any error:

sudo passwd root

and after setting password I ran this command:

sudo passwd -u root

but when I log off or reboot there is no root account!! please somebody tell me how can I login as root in ubuntu 12.04!

  • 1
    type sudo -i and then the sudo password and you will be root.
    – Alvar
    Mar 3, 2014 at 7:19
  • yes but I want to have root account in login screen!! in ubuntu 11.04 that codes work well but in ubuntu 12.04 it dosent make an root account in login screen!!
    – MSH
    Mar 3, 2014 at 7:23
  • You don't want to have a root account in the log in screen it's a bad habit. I can't see any reason why you would even want this...
    – Alvar
    Mar 3, 2014 at 7:24
  • I just need it for some reasons and also for a few days, but tnx anyway :)
    – MSH
    Mar 3, 2014 at 7:32

3 Answers 3


You can do this by editing /etc/lightdm/lightdm.conf The default contents are just:


And you can just add:


Now logout and you'll see that there is no list of users in the login window.

so you can just write root as username...

If you want to return to old lightdm window that list all users just open /etc/lightdm/lightdm.conf file and remove the added line greeter-hide-users=true


Here is a community wiki. Often many users advice you not to use Ubuntu this way. You have sudo anyway which elevates the privileges to root for a single command using your account password.

But, if you have a good reason to be root you can do that as well in Ubuntu.

Below are some useful links:

Unable to login as root from the login screen even though I have a root account

Re-enable graphical root-login on 12.04 LTS


Using Root as log in is not good, anyway if want it for some file management purpose, type "sudo nautilus" or "gksudo nautilus" whichever works in terminal and you can have your login as root.

Not the answer you're looking for? Browse other questions tagged or ask your own question.