How to add a root user to Ubuntu

Published: May 23, 2021 (Updated: May 23, 2021)

Enjoying this content? Subscribe to the Channel!

Unlock Superpowers: How to Add and Use the Root User in Ubuntu


Welcome back to Darren’s Tech Tutorials!

If you’ve ever used Windows, you know the power of being an Administrator—the ability to install anything, modify core settings, and truly own your system. In the Linux world, that ultimate authority belongs to the Root User.

By default, Ubuntu locks the direct root login for security reasons. But sometimes, when you’re troubleshooting, running specific scripts, or performing advanced system maintenance, you need those super-user privileges immediately.

This guide will show you exactly how to enable the existing root account, set its password, and test your newfound administrative power. It’s a quick, powerful tweak that every Ubuntu user should know!

What is the Root User and Why Do You Need It?

In Ubuntu, when you install your system, your personal account has administrative privileges—meaning you can use the sudo command (Super-user Do) to temporarily elevate your permissions. This is great for daily use and security, as it prevents accidental damage.

However, the true Root User is the system’s ultimate master account.

  • Windows Analogy: The Root User is equivalent to the built-in, unrestricted Administrator account.
  • Purpose: It can modify any file, change system settings, and bypass all user restrictions.
  • Security Note: Because of this power, direct root login is often disabled. When you enable it, handle it responsibly!

Step-by-Step Guide: Enabling the Root User Account

The good news is that the root user account already exists on your Ubuntu system. We just need to give it a password to activate it for direct use.

We will do all of this from the Terminal, the command-line heart of your Linux system.

1. Open the Terminal

The fastest way to access the terminal is by pressing:

Ctrl + Alt + T

2. Set the Root Password

Since you are currently logged in as a user with administrative rights, you can use sudo to set a password for the actual root account.

Type the following command and press Enter:

sudo passwd root

3. Enter Your Current User Password

The system will first ask for your current user’s password (the one you use to log into Ubuntu). This is a security check to ensure you are authorized to make this change.

4. Create the New Root Password

After authenticating, the system will prompt you twice to enter the new password for the root user:

Enter new UNIX password:
Retype new UNIX password:

IMPORTANT: Choose a strong, complex password and record it securely. Since the root user is unrestricted, its password is the most critical key to your system.

If successful, you will see a message like:

passwd: password updated successfully

Congratulations! The root user account is now enabled for direct login.

Testing Your New Root Access

Now that we have enabled the root user, let’s quickly test it to make sure the process worked and that you can switch to the administrative account whenever necessary.

The easiest way to confirm success without logging out of your current session is to switch to the root user within your current terminal window using the su (switch user) command.

  1. In the same Terminal window, type:

    su -
    
  2. The system will prompt you for the Root Password (the new password you just created, not your regular user password).

  3. If successful, your terminal prompt will change. Instead of seeing your username, you will see the word root and the prompt symbol will change from a dollar sign ($) to a pound sign (#).

    • Before: darren@pc:$
    • After: root@pc:#

The presence of the # prompt confirms you are now logged in as the ultimate system administrator!

To exit the root session and return to your standard user account, simply type exit.

Method 2: Logging In Directly (Advanced Use)

If you wanted to start a completely new desktop session as the root user (which is generally discouraged unless absolutely necessary for specific tasks), you could log out of Ubuntu. On the login screen, you would now be able to select Not Listed and enter root as the username, using the new root password you set.


Conclusion

Enabling the root user gives you complete, unrestricted control over your Ubuntu operating system. We successfully activated the account using the sudo passwd root command and verified our success by switching users in the terminal.

Remember, with great power comes great responsibility! Use the root account judiciously and only when absolutely necessary, returning to your standard user account for daily tasks to maximize security.

Did this tutorial unlock the full power of Ubuntu for you? If so, hit that like button on the video, subscribe to Darren’s Tech Tutorials for more practical guides, and drop a comment below telling us what advanced task you are tackling next! Happy computing!