How to Change User Password in Ubuntu

Updating your password on a regular basis and using a unique password for each account is a good security habit.
As a regular user in Ubuntu you can only change your own password. The root user and users with sudo privileges can change any user’s password and control how it is used or expires.
This tutorial describes how to change a user password in Ubuntu from the command line, or through the Ubuntu GUI.
Ubuntu Change Password from Command Line
In Ubuntu and other Linux distributions you can change the password of a user account with the passwd command.
To change your user account password run the passwd command without any options:
passwdYou will be prompted to enter your current password. If the password is correct, then you will be asked to enter and confirm the new password.
Changing password for linuxize.
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfullyThe next time you log in to your Ubuntu machine, use the new password.
Change Another User’s Password
The user you are logged in as must have sudo privileges to be able to change or reset another user’s password.
To change the password of another user account, run the passwd command followed by the username. For example, to change the password of a user named sansa, run the following command:
sudo passwd sansaYou will be prompted to enter and confirm the new password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfullyUbuntu Change Password from GUI
If the command line is not your preferred option, you can change your password through the GNOME Settings app. The steps below match Ubuntu 26.04 with GNOME; earlier releases follow a similar flow but the panel layout may differ.
Open Settings from the Activities overview or the system menu in the top-right corner.
In the sidebar, select System, then click Users.
To change another user’s password, click Unlock at the top of the panel and authenticate with sudo.
Click the Password row of the selected account to open the change-password dialog.
Enter the current password, then type and confirm the new password. Click Change to apply.

Conclusion
Changing a user password in Ubuntu takes one passwd command, or a few clicks in the GNOME Settings app. Pick a long, unique password (at least 16 characters mixing letters, numbers, and symbols) and update it whenever you suspect it has been exposed.
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page