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 do not show as you type. If both entries match, your password changes when ready.
This method works whether you are logged in as yourself or as the root user. If you want to change another user's password and you have administrator rights, type passwd username (replace "username" with the actual account name), then enter the new password twice. You will not need to know their old password.
Key Takeaways
- The passwd command in the terminal is the quickest way to change your password on Ubuntu.
- You must type your current password correctly before Ubuntu will let you set a new one.
- New passwords do not display as you type them, so enter them carefully and identically both times.
- Administrators can change another user's password by typing passwd username without knowing the old password.
- If you forget your password entirely, you will need to boot into recovery mode or use a live USB to reset it.
Changing your password through the Settings menu
If you prefer not to use the terminal, Ubuntu's graphical Settings process offers a password change option. Click the system menu in the top-right corner (usually showing your username or a gear icon), then select "Settings." Look for "Users" or "About" in the left sidebar, depending on your Ubuntu version.
Click on your user account, then look for a "Password" field or button. You may need to click a lock icon first to unlock the settings — Ubuntu will ask for your current password to confirm you have permission to make changes. Once unlocked, you can enter your new password in the provided field.
What to do if you forget your password
If you cannot remember your current password, the terminal method will not work because Ubuntu requires the old password first. You will need to restart your computer and boot into recovery mode. Restart Ubuntu, then hold down the Shift key as it boots. A menu will appear; select "Advanced options for Ubuntu," then choose the recovery mode option.
From the recovery menu, select "root" or "Drop to root shell prompt." You will then have access to a command line as the root user without needing a password. Type passwd your-username (using your actual username), then enter your new password twice. After that, type exit and select "Resume" to return to normal boot.
If recovery mode does not appear during boot, you can create a live USB with Ubuntu on another computer, boot from it, and use its terminal to access your system's files and reset the password that way. This is more complex but works on any Ubuntu system.
Creating a strong password you will actually remember
Ubuntu does not enforce a specific password length or complexity by default, but a strong password protects your system from unauthorized access. A good approach is to use a mix of uppercase and lowercase letters, numbers, and symbols — for example, "BlueMoon$42Kitchen" is stronger than "password123."
Avoid using dictionary words, your username, or information someone could guess (like your birth year or pet's name). If you struggle to remember complex passwords, consider using a password manager like Bitwarden or KeePass, which stores encrypted passwords and can generate strong ones for you.
Changing the password for the root user
The root user is Ubuntu's superuser account with full system access. If you have administrator rights on your own account, you can change the root password by opening a terminal and typing sudo passwd root. Ubuntu will ask for your own password first, then prompt you to enter the new root password twice.
Be cautious with the root password — if you lose it, you will need recovery mode or a live USB to regain access. Many Ubuntu users leave the root account locked (which is the default) and use sudo commands instead, which is generally safer because it logs which administrator performed which action.
Troubleshooting password change problems
If you type passwd and see an error like "Authentication token manipulation error," your system may have a temporary issue. Try restarting your computer and attempting again. If the error persists, you may need to boot into recovery mode and run passwd from there.
If the Settings menu does not show a password option, you may not have administrator rights on your account. Contact the person who set up your Ubuntu system — they can either grant you permission or change the password for you. If you are the only user and cannot access settings, recovery mode is your next step.
Frequently Asked Questions
Do I need to restart Ubuntu after changing my password?
No. Your new password takes effect when ready. You will use it the next time you log in, lock your screen, or run a command with sudo. You do not need to restart the computer.
Can I change my password without using the terminal?
Yes. Open Settings, find the Users section, click your account, and look for a Password field or button. You may need to click a lock icon to unlock the settings first. This method works the same way as the terminal but uses the graphical interface instead.
What happens if I type the new password wrong twice?
Ubuntu will reject the change and ask you to try again. The passwords must match exactly. If you make a mistake, just run passwd again and enter the new password more carefully. There is no penalty for trying multiple times.
Can I change my password if I am not the administrator?
Yes, you can change your own password using passwd or Settings. You cannot change another user's password unless you have administrator rights. If you need someone else's password changed, ask a system administrator on your computer.
Is my old password stored anywhere after I change it?
No. Ubuntu overwrites the old password hash with the new one. The old password is not recoverable. If you forget your new password, you will need to use recovery mode to reset it.