How to enable the root user account in Ubuntu Linux

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.

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:

# sudo passwd root

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.

To enable the root user to now log into Gnome, open the file gdm.conf which will most likely be at /etc/X11/gdm/gdm.conf and change the AllowRoot condition to:


Save the file. Log out of Gnome and log back in to activate your new settings.


I am a g33k, Linux blogger, developer, student and Tech Writer for My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.