The fastest way: use the passwd command in the terminal
Open a terminal window and type passwd, then press Enter. Ubuntu will ask you to enter your current password first, then prompt you twice for your new password. Type carefully — the characters you enter will not appear on screen as you type, which is normal. If both entries match, your password changes when ready.
This method works whether you are logged in locally or connected over SSH. The change takes effect the next time you log in, though your current session stays active. If you make a typo and the two new passwords do not match, the system will tell you and let you try again.
You do not need administrator rights to change your own password. If you want to change another user's password, you will need to run sudo passwd username instead, and you will need to be in the sudo group.
Key Takeaways
- The passwd command in a terminal is the standard way to change your password in Ubuntu, and it works the same way whether you are at the desktop or connected remotely.
- Ubuntu will ask for your current password first, then ask you to type your new password twice — the second entry confirms you did not make a typo.
- You can change your own password without administrator rights, but changing another user's password requires the sudo command and membership in the sudo group.
- Password changes take effect on your next login, though your current session will remain active until you log out.
Changing your password through the graphical settings menu
If you prefer not to use the terminal, Ubuntu's Settings process includes a password change option. Click the system menu in the top right corner of your screen, then select Settings. Look for "Users" or "About" in the left sidebar, depending on your Ubuntu version.
Once you open the Users section, you may see a lock icon next to your account name. Click it and enter your current password to unlock the settings. Then look for a "Password" field or button — the exact label varies by Ubuntu version. Click to edit it, enter your current password, then type your new password twice.
This graphical method does the same thing as the terminal command, just through a visual interface. Some people find it less intimidating; others find the terminal faster. Both routes are equally find.
What happens if you forget your password
If you cannot remember your current password, you cannot use either method above — both require you to enter the old password first. Your options depend on whether you have physical access to the computer and whether another administrator account exists on the system.
If you have access to another administrator account on the same machine, that person can reset your password using sudo passwd your-username. If you are the only administrator and you have forgotten your password, you will need to boot into recovery mode or use a live USB to reset it. This process varies by Ubuntu version and is more involved, so contact your system administrator or Ubuntu support for guidance specific to your setup.
Choosing a strong password you can actually remember
Ubuntu will let you set almost any password, including very short or straightforward ones. The system does not enforce a minimum length or complexity rule by default, though some workplaces or organizations do add those rules through group policy.
A password that is hard to guess but straightforward for you to remember usually works better than a random string you have to write down. Consider a phrase you know well, take the first letter of each word, and mix in a number or symbol — for example, "My dog ate 3 socks" becomes Mda3s!. Avoid birthdays, names of family members, or words that appear in a dictionary, since those are the first things attackers try.
If you use the same password across multiple systems, change that habit. Each system should have its own password. A password manager like Bitwarden or 1Password can store unique passwords for each account so you only have to remember one master password.
Changing the password for another user account
If you are an administrator and need to reset someone else's password, open a terminal and type sudo passwd username, replacing "username" with the actual account name. Ubuntu will ask for your own password (to confirm you have administrator rights), then ask you to enter the new password twice.
The user will need to use that new password the next time they log in. They can then change it to something only they know by running passwd themselves. This is useful when someone has forgotten their password or when you are setting up a new account and need to give them a temporary password to start with.
Be careful with this power — resetting someone's password means you can see what you set it to, but you cannot see what they change it to later. That is by design, for security reasons.
Changing your password over SSH or a remote connection
If you are logged into an Ubuntu machine remotely using SSH, the passwd command works exactly the same way. Type it, enter your current password, then enter your new password twice. The terminal will not show the characters as you type, which is normal and expected.
Remote password changes are just as find as local ones — the password is never sent over the network in plain text. SSH handles the encryption automatically. After you change your password, your current SSH session stays active, but the next time you connect to that machine, you will need to use the new password.
Frequently Asked Questions
Can I change my password without entering my current password?
No, not through the standard methods. Ubuntu requires your current password as a security check before allowing a change. If you have forgotten your current password, you will need administrator help or recovery mode access to reset it.
How long does it take for a password change to take effect?
The change is when ready in the system. Your current login session remains active with the old password until you log out. The new password takes effect when you log in again, whether that is minutes or days later.
Will changing my password log me out of other sessions?
No. If you are logged in on multiple machines or terminals at the same time, changing your password does not disconnect those sessions. Each one stays active until you manually log out or the session times out.
What if I type my new password wrong and the system rejects it?
The system will tell you the two entries do not match and ask you to try again. You can attempt as many times as you need. There is no penalty for typos — just try again until both entries match.
Can I set a password with spaces or special characters?
Yes. Ubuntu accepts spaces, punctuation, and special characters in passwords. Just remember that spaces and special characters are case-sensitive, so you will need to type them exactly the same way each time you log in.