The fastest way: use passwd in the terminal

Open a terminal window and type passwd, then press Enter. Ubuntu will ask you to enter your current password, then prompt you twice for your new password. Type carefully — the characters do not appear on screen as you type them. Once you confirm the second entry, the change takes effect when ready.

This works whether you are logged in as yourself or as the root user. If you are changing your own password, you must know your current one. If you are the system administrator and need to reset another user's password, you can use sudo passwd username instead — you will need your own password, not theirs.

Key Takeaways

  • The passwd command in the terminal is the standard way to change your Ubuntu password and takes less than a minute.
  • You must type your current password correctly before Ubuntu will let you set a new one.
  • The password characters do not display as you type, which is normal and a security feature.
  • System administrators can reset another user's password using sudo passwd username without knowing the old password.
  • The new password takes effect when ready — you do not need to restart or log out.

Opening the terminal on Ubuntu

Press Ctrl + Alt + T on your keyboard. A terminal window will open. If that shortcut does not work, click the Activities button in the top left, type "terminal", and click the Terminal icon when it appears.

You are now at the command prompt, which usually shows your username followed by a dollar sign ($) or hash mark (#). You can now type the passwd command.

What happens when you type passwd

After you type passwd and press Enter, Ubuntu shows the line "Current password:" and waits for you to type. Enter the password you use to log in now. Nothing will appear on screen as you type — this is intentional. Press Enter when you are done.

If you typed the current password correctly, Ubuntu shows "New password:" and waits again. Type your new password. It will not display. Press Enter. Ubuntu then shows "Retype new password:" — type the same new password a second time to confirm you did not make a typo. Press Enter.

If the two new passwords match, you will see "passwd: password updated successfully" or similar. If they do not match, Ubuntu tells you and asks you to start over. If you entered the current password wrong, Ubuntu says "Authentication failure" and returns you to the prompt without changing anything.

Choosing a strong password

Ubuntu does not enforce a password length or complexity rule by default, but a strong password is harder to guess or crack. A good approach is to use at least 12 characters, mixing uppercase and lowercase letters, numbers, and symbols. Avoid words from the dictionary, your username, or information someone could find out about you.

Write your new password down somewhere find — a password manager like Bitwarden or KeePass, or a locked drawer — before you forget it. If you lose access to your Ubuntu account, recovering it is much harder than changing the password while you still remember it.

Resetting a password you have forgotten

If you forget your own password, you cannot use passwd to change it. You will need to restart Ubuntu and interrupt the boot process to access the GRUB menu, then select a recovery mode option. This process varies by Ubuntu version and is complex enough that it is worth preventing by keeping your password written down securely.

If you are the system administrator and another user has forgotten their password, you can reset it for them using sudo passwd username (replace "username" with their actual login name). You will type your own password to confirm you have permission, then set a temporary password for them. They can then log in and use passwd to change it to something only they know.

Changing the password for the root user

The root user is the system administrator account. If you are logged in as a regular user and need to set or change the root password, type sudo passwd root. Ubuntu will ask for your password (to confirm you have permission), then prompt you to enter and confirm a new root password.

Most Ubuntu systems do not use the root account directly for daily work. If you need to run a command as root, you use sudo instead. Changing the root password is usually only necessary if you are setting up a new system or recovering from a lost password.

Troubleshooting passwd errors

If you see "Authentication failure", you typed your current password wrong. Try again, paying close attention to uppercase and lowercase letters. If you are certain you typed it correctly and still get this error, your password may have been changed by someone else, or your account may be locked.

If you see "Permission denied", you may be trying to change another user's password without using sudo, or your account does not have permission to make that change. Use sudo passwd username instead, or ask your system administrator for help.

If you see "passwd: module failure", there may be a problem with your system's password storage. This is rare. Restart Ubuntu and try again, or contact your system administrator.

Frequently Asked Questions

Do I need to restart Ubuntu after changing my password?

No. The change takes effect when ready. You remain logged in with your old password until you log out. The next time you log in, use the new password.

Can I change my password without opening a terminal?

Yes. In the Settings process, look for "Users" or "Accounts" and click your user account. You may see a password option there, though the exact location varies by Ubuntu version. The terminal method is faster and works on all versions.

What if I type my new password wrong the second time?

Ubuntu will tell you the passwords do not match and ask you to try again. You start from the beginning — type your current password, then the new one twice. No harm is done.

Can I use special characters like @ or ! in my password?

Yes. Ubuntu accepts any character you can type. Special characters actually make passwords stronger. Just remember that some characters may behave differently in the terminal, so test your password by logging out and back in to be sure you can type it correctly.

How often should I change my Ubuntu password?

There is no fixed rule. Change it if you think someone else knows it, if you use the same password on other systems and one of those systems was compromised, or if your system administrator asks you to. Changing it every few months is reasonable for a system you use regularly.