How to create the root account in Ubuntu

ubuntu root logon

In Linux the root account It is the most important and the one that allows manage the system, not only creating user accounts and installing tools, but also managing everything related to security, access permissions and more. For this reason, it is not recommended to use it for daily tasks and instead it is sought that each user accesses with their account and, if they have administrative rights, switch to the root account when necessary.

But since many continued to use the root account due to laziness of changing all the time, several distros chose to force the scheme of using user accounts and performing administrative tasks with the 'su' or super user command. However, it is still perfectly possible to work in the old way and now we are going to show how to create a root account in Ubuntu.

To start we execute the command:

sudo passwd

When we are asked for a password we enter it and then repeat it to confirm. Now the root user already has his own password but we still need so that you can enter with this data when starting the system. It is that by default, Ubuntu does not offer the manual logon but we have to select a user from a list and then provide their password. We enable the manual logon:

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

We go to the end of the file and add:


Now we only have to restart, and the next time we see the welcome screen we can enter with the root account, putting 'root' in the username and entering the corresponding password below.

More information - Canonical expands Ubuntu's reach in China

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

4 comments, leave yours

Leave a Comment

Your email address will not be published.



  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Alejandro said

    Do you want to use the graphical interface as root? Why ??

    1.    Willy klew said

      Hello Alejandro! thanks for comment
      It is not about using the graphical interface or not, it is a solution for those users who want to log in as root and stay that way, even knowing the security risks that this implies. Many people do it, even if it is not recommended, and for that reason I have been consulted many times about how to do it in Ubuntu and here is that procedure for whoever wants it.

      But, I repeat, it is by no means recommended


  2.   sd0625 said

    Do you realize the half security hole that you are opening?
    I understand the need to activate root with your password and be able to
    login to a tty, in fact, I have no idea why in Ubuntu it is not
    like this from the beginning, but another thing is to log in as root in a
    desktop environment, running dozens of processes that do not come to the
    case of the administrative task you want to do.

    I find the first part of your article correct, there are
    some things only true root can do, not a user
    with sudo, so the possibility of logging in as such is always

    You say it's annoying to hit sudo all the time? You have two options
    feasible to do in any terminal, even in an emulator like
    gterminal –or whatever the gnome / unity one is called– running a desktop
    as a normal user.

    1. No need to give root password:

    $ sudo -i

    2. With root password:

    $ su

    I leave O_o about "doing it the old way", the old way is as I explained to you, another thing is comfort. In fact, his and his cousin sudo are older than the black thread, from before the GNU project was formed.

    I'm a bit wary of running any graphical interface as root, understand how I knew when I saw that you want to run an entire desktop environment as such. You imagine? unity and its amazon lens running as root, while your weather widget tries to connect and you watching the tutorial to install the module for the HP printer on youtube with flash and in another tab a java applet is running. root !!!, a Gruyère cheese has fewer holes. Lastly, use something more sane like kdesu - I think gnome's is called gtksu - to run a privileged GUI program.

  3.   neotron said

    Bravo for the post! There are always the experts who are alarmed by the security hole, who complain I don't know what ... they should work for Microsoft if they care so much about the safety of others.