The fastest way: use passwd in the terminal

Open a terminal and type passwd, then press Enter. Ubuntu will ask you to type your current password once, then your new password twice. That is the entire process — no reboot needed, no settings menu to navigate.

The new password takes effect when ready. You will use it the next time you log in, or the next time Ubuntu asks for your password to install software or change system settings.

Key Takeaways

  • The passwd command in a terminal is the standard way to change your password on Ubuntu.
  • Ubuntu requires you to enter your current password before setting a new one, as a security check.
  • Your new password must be typed twice to confirm you did not make a typo.
  • The change takes effect when ready and applies to login, sudo commands, and any other password prompts on your system.
  • If you forget your password entirely, you will need to boot into recovery mode or use another administrator account to reset it.

What happens when you type passwd

When you run passwd without any options, Ubuntu assumes you want to change your own password. The system will prompt you three times: once for your current password (to verify you have the right to change it), then twice for your new password (the second entry confirms you typed it correctly).

Ubuntu does not show the characters you type for security reasons — the cursor will not move or show dots. This is normal. Type carefully, because you cannot see what you entered.

If you mistype your current password, Ubuntu will reject the change and you can try again. If your new passwords do not match, Ubuntu will ask you to start over with the new password entry.

Changing another user's password (if you are an administrator)

If you have administrator privileges, you can change another user's password by typing passwd username, replacing "username" with the actual account name. For example, passwd alex would let you reset the password for a user named Alex.

When you change someone else's password this way, Ubuntu will not ask for their current password — only for the new password twice. This is how system administrators reset forgotten passwords. The user will need to use the new password to log in next time.

Making your password stronger

Ubuntu does not enforce a single password rule for all users, but it will warn you if your password is too straightforward. A stronger password uses uppercase letters, lowercase letters, numbers, and symbols — and is at least 12 characters long.

Avoid passwords based on dictionary words, your username, your name, or information someone could guess from your social media. A random mix of characters is harder to crack, but a long phrase you can remember (like "CoffeeOnTuesday2024!") works just as well.

If you forget your password

If you cannot remember your password and have no other administrator account on the system, you will need to boot into recovery mode. Restart your computer, hold down Shift as it boots, and select "Advanced options for Ubuntu" from the menu. Choose the recovery mode option, then select "Drop to root shell prompt".

From the root shell, type passwd username (with your actual username) and set a new password. You will not need to enter the old one because you are running as root. Type exit to leave the shell, then select "Resume" to boot normally with your new password.

This process requires physical access to your computer — someone cannot reset your password remotely without this access.

Changing your password through the graphical settings

If you prefer not to use the terminal, you can change your password through Ubuntu's Settings process. Click the system menu in the top right corner, select your username, then click "Settings". Go to "Users" and click the lock icon to unlock the user settings (you will need to enter your current password).

Click on your account, then look for a "Password" field. Click it and you will be prompted to enter your current password, then your new password twice. The graphical method does the same thing as the passwd command, just with a visual interface instead of text prompts.

What to do if passwd gives you an error

If you see "Permission denied" or "Authentication failure", you either typed your current password wrong or you do not have permission to change passwords on this system. Try again, paying close attention to uppercase and lowercase letters.

If you see "passwd: password updated successfully" or no error at all, your password has been changed. Some versions of Ubuntu show a success message; others show nothing and straightforward return you to the command prompt. Both mean the change worked.

If you see "passwd: module is unknown", your system may have a non-standard password setup. This is rare on standard Ubuntu installations. Contact your system administrator or the person who set up your computer.

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 or the next time Ubuntu asks for your password — you do not need to reboot.

Can I change my password if I am not connected to the internet?

Yes. Your password is stored locally on your computer, not on a remote server. The passwd command works whether you are online or offline.

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

Ubuntu will tell you the passwords do not match and ask you to enter the new password again. Your old password remains unchanged, and you can try again.

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

Yes. Ubuntu passwords can include letters, numbers, spaces, and any special character on your keyboard. Special characters actually make passwords stronger.

If I change my password, will it affect my login to websites or email?

No. Your Ubuntu password only controls access to your computer. It has nothing to do with passwords for websites, email accounts, or other online services.