How to Change User Password in Ubuntu

By 

Updated on

3 min read

Ubuntu Change Password

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:

Terminal
passwd

You 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.

output
Changing password for linuxize.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Info
Password is not shown on the screen when you type it.

The 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:

Terminal
sudo passwd sansa

You will be prompted to enter and confirm the new password:

output
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Ubuntu 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.

  1. Open Settings from the Activities overview or the system menu in the top-right corner.

  2. 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.

  3. Click the Password row of the selected account to open the change-password dialog.

  4. Enter the current password, then type and confirm the new password. Click Change to apply.

    Ubuntu 26.04 GNOME change password dialog

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

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