How to enable the root user account in Ubuntu Linux

by Sukrit Dhandhania on May 28, 2009

Linux Security

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:

AllowRoot=true

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