Cybersecurity Updates & Tools

Change User Password in Ubuntu: Command Line and GNOME GUI

Using a strong, unique password for every account is one of the most effective security habits. A compromised password accounts for a large share of account breaches, and reusing passwords across services means one breach cascades into many.

This guide shows how to change a user password in Ubuntu from the command line with the passwd command, and through the GNOME Settings app.

Change Password in Ubuntu from the Command Line

The passwd command handles password changes in Ubuntu and all other Linux distributions. Despite its name, it does not write to /etc/passwd. Passwords were originally stored there, but since /etc/passwd is world-readable by all users, they were moved to /etc/shadow – a file readable only by root. passwd updates the hashed password entry in /etc/shadow.

To change your own password, run passwd with no arguments:

bashpasswd

You are prompted in three steps:

  1. Current password – confirms you are the account owner, not someone who walked up to an unlocked terminal
  2. New password
  3. Retype new password – prevents a typo from locking you out of your own account
Changing password for linuxize.(current) UNIX password:Enter new UNIX password:Retype new UNIX password:passwd: password updated successfully

Passwords are not shown on screen as you type — standard terminal behavior to prevent shoulder surfing. Use the new password the next time you log in.

Change Another User’s Password as Root or sudo

Changing another account’s password requires sudo privileges:

bashsudo passwd sansa

When run with sudo, the command does not prompt for the user’s current password. Root bypasses the current-password check, which is exactly why this method works for resetting a forgotten or locked account, there is no chicken-and-egg problem.

You are prompted only to enter and confirm the new password:

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

Force a password change at the next login. When you set a password for someone else, it is good practice to expire it immediately so the user sets their own rather than keeping the admin-assigned one:

bashsudo passwd -e sansa

This marks the password as expired. The next time that user logs in, they are required to set a new password before the session starts.

To review an account’s password expiry details:

bashsudo chage -l sansa

The output shows the last password change date, the expiry date, and the warning period — useful when auditing password hygiene across multiple accounts on a shared server.

Change Password in Ubuntu Using the GNOME Settings App

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

In the sidebar, select System, then click Users.

To change your own password: click the Password row directly. The change-password dialog opens without extra authentication.

To change another user’s password: click Unlock at the top of the panel first. This triggers a PolicyKit authentication prompt — you authenticate with your sudo password to gain elevated access to user account management. Once unlocked, select the target account and click the Password row.

In the dialog, enter the current password for the account, then type and confirm the new password. Click Change to apply.

These steps match Ubuntu 26.04 with GNOME. Earlier Ubuntu releases follow a similar path but the panel layout may look slightly different.

Keep passwords at least 16 characters long and mix letters, numbers, and symbols. Change any password immediately if you suspect it has been exposed or shared. Leave a comment below if you run into any issues.