How to Change password in Ubuntu 22.4 using terminal and GUI

Looking for a way to change the root password on Ubuntu 22.4? Basically, while installing Ubuntu you create a user and set a password for it. But sometimes for system admin need root passwords to manage or change the password for other users on your system. Or for some other reason, you may need to change your password. Here This tutorial describes how to change a user password and Root password in Ubuntu using the terminal or Ubuntu GUI.

Note: Your Ubuntu Linux account information is stored in a file named /etc/passwd and encrypted password in /etc/shadow.

Change user password in Ubuntu

If you want to change your current password, simply run this command in a terminal:

passwd

You’ll be asked to enter your current password and the new password twice.

passwd
Changing password for zillowtech.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

If you want to change the password for some other user,

you can do that as well with the passwd command. But in this case, you’ll have to use sudo.

Here example

sudo passwd <Zillowtech1>

Changing password for zillowtech1.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

If you changed your password and forgot it later, don’t worry. You can easily reset Ubuntu password.

Change Root password in Ubuntu

Did you know by default By default, the root user in Ubuntu doesn’t have a password.

You notice while installing Ubuntu you are forced to create a user account and that user account has admin access. And that admin user can gain root access using the sudo command but it uses its own password as it’s not using the root account.

Well, you can set root password using passwd command.  But in most cases, you don’t need it as your user account has root access.

sudo password root

Change Ubuntu password using GUI

Changing the Ubuntu password using GNOME is easy and pretty simple.