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.
- 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:
- 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 /etc/gdm3/custom.conf and add the line:
- 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:
# sudo passwd root
auth required pam_succeed_if.so user != root quiet_success
so that it reads:
# auth required pam_succeed_if.so user != root quiet_success
- 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?