Ubuntu: log in as root in ubuntu 12.04 [duplicate]


This question already has an answer here:

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!


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

[SeatDefaults]  greeter-session=unity-greeter  user-session=ubuntu  

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.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »