How To Enable or Disable Root User in Linux
We show you how to enable or disable a root user account on Linux systems like Ubuntu, Cent0S or Debian.
Disable Root User & Delete Password
To execute this process we must change the user with whom we have logged in to the root user, for this, we run the following command and enter our administrator password.
Once we are as root users we must execute the following command to eliminate the root password:
passwd --lock root
This command will allow us to completely disable the access to the root user, to verify it we will try to enter as root user entering our password and we will see the following:
Another security option that we can use with the root user is to modify his current password using the command:
passwd -d root
Enable Root User
If after all this process we need to use the root user again we can enable it again in the system using the following command:
sudo passwd root
In the expanded window we must establish a password for the root user.
We have seen how we can obtain this security advantage by disabling the root user, but we must do this if necessary, and our system does not have many users access, or we know that the people who access are trustworthy and authorized.
If we still need it again, you've seen how easy it is to re-enable this root user.
Linux is not the only system where the root superpowers are used, and Android is an example.