How to Enable the Root User Account in Ubuntu Linux

This guide will show you how to enable the “root” user in Ubuntu, and how to allow the root user to use Gnome.

Ubuntu Linux ships with the tool sudo all setup for you to use to perform any administrative tasks instead of giving you root user privileges. If you have used other flavors of Linux and performed any administrative tasks on them you will quite likely feel a bit constrained by sudo, even though you can do just about anything you can as root with sudo. In such cases you can enable the root user account which has been disabled by Ubuntu by default. Note: this could pose a security risk and is not recommended for beginners.

  1. There are two levels at which you can enable root access – the command line and in the Gnome desktop. To enable the root user login on the command line run the following command:
  2. # sudo passwd root

  3. The command line will prompt you to enter your password, and then the new root user password twice. Enter them correctly and your root command line login should be good to go.
  4. To enable the root user to now log into Gnome, open the file /etc/gdm3/custom.conf and add the line:
  5. AllowRoot=true

    an Ubuntu terminal editing a config file to enable root in ubuntu

  6. Then you’ll need to edit the configuration file /etc/pam.d/gdm-password – specifically you’ll need to add a # (pound sign, number sign) in front of the line:

auth required user != root quiet_success

so that it reads:

# auth required user != root quiet_success

a Terminal in Ubuntu adding a comment to a file

  1. Save the file. The next time you sign into Ubuntu select Not listed? and then enter root as the username and the password you created back in steps #1-2. That’s it – you’re all done!

If you’re enabling root you’re probably comfortable with being a bit lax on security, so maybe you’d like to automatically sign-in to Ubuntu too?

If this article helped you, I'd be grateful if you could share it on your preferred social network - it helps me a lot. If you're feeling particularly generous, you could buy me a coffee and I'd be super grateful :)

buy a coffee for

Home » Linux » How to Enable the Root User Account in Ubuntu Linux

1 thought on “How to Enable the Root User Account in Ubuntu Linux”

Leave a Comment

Your email address will not be published.