Ubuntu does not enable the root account during installation and you will not be asked to create a root password. Instead, you will create a normal user account with sudo privileges. This user can run sudo command to perform administrative tasks. We can enable Ubuntu root account by giving it a password by using the passwd command.Disable Root User Account in Ubuntu If you previously enabled the root user in Ubuntu and now you want to disable it, set the root password to expire. To disable the root account password, use the following command: sudo passwd -l root How To Enable Root SSH Login On Linux Root Password. The first step to enabling Root login over SSH is to enable the Root account. For many LinuxEnable Root Login. Now that we know it’s possible to log in as a Root user, it’s time to enable the Root login settingApplying Root Setting. Now that Root login is enabled in the settings, you’ll need to restart the SSH More In Ubuntu, you can set or change the password of a user account with the passwd command. To change the password of the root user in Ubuntu, run the following command as a sudo user: sudo passwd root. You will be prompted to enter and confirm the new root password. When setting the password, make sure you’re using a unique and robust password.
How do I create a root account in Ubuntu?
Ubuntu does not enable the root account during installation and you will not be asked to create a root password. Instead, you will create a normal user account with sudo privileges. This user can run sudo command to perform administrative tasks. We can enable Ubuntu root account by giving it a password by using the passwd command.
How do I disable the root user in Ubuntu?
If you previously enabled the root user in Ubuntu and now you want to disable it, set the root password to expire. To disable the root account password, use the following command: sudo passwd -l root
How do I enable root logins in Linux?
To actually enable root logins first you have to set a password for the root account and then unlock the locked root account. If you don't set a password for the root account the passwd command will return. passwd: unlocking the password would result in a passwordless account. So, first execute in a terminal.
How to change the root password in Ubuntu?
Open the Ubuntu terminal and run the groups command to make sure that you are a member of the sudo admin group: If you have sudo privileges, then you can set the root password with following command:

Below are two helpful articles on a similar topic 👇
How do I switch from root to normal user in Su?Is WSL2 available with Windows 10?