The world’s top Linux distribution is Ubuntu. This Linux distribution may be installed on servers even though it was created for personal computers (PCs). Based on the Debian design is Ubuntu. It offers its users a variety of features, one of which is the ability to alter the root user’s password. Changing your password periodically not only makes it less likely that you will be hacked, but it also increases security.
An essential part of the installation procedure is setting up a user account and password with root access. Most of the system maintenance is performed by the root account, commonly referred to as the superuser, which is also used to install packages and upgrade RPM packages. When you utilize the root account, you have total power over your system.
Password changes are a good idea; thus, they should be made often. Linux enables the establishment of several user accounts, each with a unique password that may be changed by the user. Root users can modify any account’s password, even their own.
Ways to Change Root Password of Ubuntu 22.04
If you’re migrating to Ubuntu from some other Linux distribution, you might be curious about the root password’s default value and how to modify it. For security reasons, the Ubuntu system disables the root user account by default. The three methods to change Ubuntu’s root password are listed below.
- Use Graphical User Interface to Change the Root Password of Ubuntu 22.04
- Use sudo Command to Change the Root Password of Ubuntu 22.04
- Use passwd Command to Change the Root Password of Ubuntu 22.04
Use Graphical User Interface to Change the Root Password of Ubuntu 22.04
You can update the password using a graphical user interface if you are a newbie and are unfamiliar with using a terminal.
Step 1: Open Setting
Open Activities Overview, enter “setting” in the search field and then click the setting symbol to bring up a new window.
Step 2: Change the Password
The root user’s details and password are displayed when you choose the “Users” option on the left side of the screen. To alter the root user’s password, first, unlock it by clicking the unlock button, and then select the password field.
A new pop-up window where you need to provide the relevant information that’s been asked as shown below:
Use sudo Command to Change the Root Password of Ubuntu 22.04
Giving regular users access to sudo encourages Ubuntu users to do system administrative tasks. Using “sudo,” authorized users can execute programs as another account, often the root user. Run the command listed below to modify the sudo password.
$ sudo passwd root
A new password must be created and verified. The result will demonstrate that the password update was successful.
Use the passwd Command to Change the Root Password of Ubuntu 22.04
The root user can modify the password for any account on the system, whereas a regular user can only do so for their own account using the below command.
$ sudo -i
Now you can run commands as the sudo user after inputting your current password and pressing Enter.
Logout from the system is recommended once the password is changed using the below command:
Changing a password is a healthy habit as this will stop security thefts or may be made for a number of other reasons. Three of the methods for changing a password offered by Ubuntu—using the command line, the passwd command, and a graphical user interface—are explained in this article. You can use any of the strategies based on your needs.