If you are using an Ubuntu 22.04 or 20.04 system, and you want to change the user’s password by username, the root user’s password, or Ubuntu own password, then for this you can use the sudo passwd, sudo root passed, and passwd commands.
Ubuntu 22.04 Change Password Command Line
Here are some approaches to change ubuntu, root user password, and sudo username password in linux ubuntu 22.04 using command line:
Press Ctrl
+ Alt
+ T
to open a terminal window. You can also search for “Terminal” in the applications menu.
Approach 1 – Ubuntu change the user password using terminal
Once you have identified the username, you can change the user’s password using the passwd
command. Replace USERNAME
with the actual username.
Execute the following command on the command line to change a password for a user named “tutsmake” in Ubuntu:
sudo passwd tutsmake
Approach 2 – Change Root User Password Ubuntu 22.04|20.04
To change the root user password ubuntu, you need to become the root user. You can achieve this by using the sudo
command. Type the following command and press Enter
. You will be prompted to enter your user account password.
sudo -i
Once you are logged in as the root user, you can change the root password using the passwd
command. Simply type passwd
and press Enter
. You will be prompted to enter the new password and then confirm it by typing it again. The password will not be displayed as you type it for security reasons.
sudo passwd root
Approach 3 – Change Ubuntu Password Command Line
To change the password of the system of Ubuntu, you have to type the passwd command on the terminal and hit enter, and it will open the new password and confirm password prompt on the terminal, through which you can change its password:
passwd
Here is the video guide on How to Change Password on Ubuntu 22.04 Terminal:
Conclusion
Through this tutorial, we have learned how to change or update passwords in Linux ubuntu using command line or terminal.