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.
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:
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.
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.
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.
Ubuntu locks the root account by default. New users often wonder what the root password…
Since Ubuntu 17.10, networking is configured with Netplan rather than the older /etc/network/interfaces file. You write a…
Docker is an open-source containerization platform that packages an application and everything it depends on…
When two or more installed programs provide the same command name, the system needs a…
Install Docker on Ubuntu 26.04: Official Repository Setup GuideDocker is an open-source container platform that…
Asterisk is the most widely deployed open-source PBX (Private Branch Exchange) platform in the world. It…