If you want to perform any task in Linux, it is necessary enable root user in Ubuntu.

How to enable root user in Ubuntu?

It is important to know that if you want to perform a task in Linux you must have all root permissions. When you install Ubuntu on the disk, a user account is also automatically created, in which you must set a password.

Although that user can often be confused with root, it is not the same. And, for this, we leave you the definition below to clarify all your doubts.

What is the root user?

The root user in Ubuntu is one of the types of user profiles that is available within the system. In addition, you have all the permissions to carry out any changes or modifications that are necessary.

However, it is important that the root user is not confused by the use of the command »sweat», which is frequently used by the main user.

Remember that, having installed the command »sweat» It depends on the preferences of each one, however, if it is an online server, it is not recommended because it can increase the risk of your information being shared.

The best thing to do is to create a root user, and then disable the command »sweat» in your main account.

How to know if the root user is active?

Generally, this user is not active, however, to know its status, all you have to do is open a window in the terminal and enter the following: sudo su.

If the user is active, the character # must appear at the prompt. And, if it is disabled, you should see the following messages:

If this is your case, it is important to know all the steps with which you can enable user root in Ubuntu, and then, we leave them to you:

Enable root user in Ubuntu

Linux is an operating system that is characterized by offering different options for you to carry out all tasks, including even the most complicated ones.

Now, in case you want to carry out a simple maintenance, for example, you have the option of using all the tools that the root user has with your main account. However, if it is a more complicated task, it is necessary to use the root user account.

For enable root user in Ubuntu There are two options or better known as commands, and we will teach you each one of them so that you can choose the one that best suits you.

1) Root from the main account

The first option offers you two ways that you can use to activate the root user from the main account.

  • With the first you must place sudo, and then continue with a command. For example: sudo apt install gimp
  • While, the second way to execute commands with privileges very similar to the root user from the main account, must be placing: sudo su.

For each of the forms it is necessary to enter a password. So, surely you are wondering, but what is the difference between one method and another? Next, we explain.

With the first way, you have to make sure to type sudo every time you are executing a command, in this case »root». While, with the second you only have to write sudo su once and that's it, you'll be in administrator/root mode.

2) Use the root user

With this option, what is sought is to keep the root user active, and that it be separated from the main account.

  • The first thing you should do is open the terminal, and type in the command sudo.
  • Then set a password for the root user.
  • And, it would be as follows: sudo passwd root.
  • The system asks you to enter the password twice.
  • A message appears in the terminal, such as the following: passwd: password updated successfully.

How to check that root account is active?

The easiest way to check if the root account is active is by placing the command sudo su.

If everything was carried out correctly, the prompt should show the # character, indicating the root user.

Another widely used method is by logging out of the main account and logging in as root. The only thing you have to do is, in the space to log in, modify the name that appears by default, and enter the one of »root», and as password you must put the previously established one.

If you put everything correctly, the next thing is to enter the new session, and you open the terminal to see that the # character is found at the beginning.

How to disable root user in Ubuntu?

  • In your main account, you must open a new terminal, where you can type the command: sudo passwd -dl root.
  • The next thing you should do is enter the password, and something similar to what we left you should appear on the screen below:
enable root user in Ubuntu
  • After this, log out, and if you want to login again as root, the system will respond with an error message. And, it is because there is no longer access for the root user.
  • Thus, you can have control to work with your root account on the local system or on the online server.