The fastest way: use the passwd command

Open a terminal and type passwd, then press Enter. Linux will ask you to enter your current password, then prompt you twice for your new password. Type carefully — the characters you enter will not appear on screen, which is normal. Once you confirm the new password the second time, the change takes effect when ready.

This method works on any Linux distribution and requires no special permissions. You are changing your own password, so the system trusts you to do it without asking for administrator approval.

Key Takeaways

  • The passwd command in a terminal is the standard way to change your password on any Linux system.
  • You must know your current password to change it — the system will ask for it first as a security check.
  • Password characters do not display as you type, which is intentional and keeps your password safe from shoulder surfers.
  • If you forget your password, you will need to boot into recovery mode or use a live USB to reset it, since you cannot change what you cannot remember.

What happens when you run passwd

When you type passwd and press Enter, the system runs through four steps. First, it asks for your current password and checks it against what is stored in the system files. If you enter it wrong, the command stops and you can try again. This prevents someone who sits down at your unlocked computer from changing your password without knowing the old one.

Second, the system prompts you to enter your new password. Third, it asks you to type the new password again. If the two entries do not match exactly, the system rejects the change and asks you to start over. Fourth, once both entries match, the system updates the password file and the change is complete. You do not need to log out or restart — your new password works when ready the next time you log in.

Choosing a password the system will accept

Most Linux systems enforce a minimum password length, usually 8 characters. Some distributions also check whether your new password is too similar to your old one and will reject it if the change is too small. A few systems require at least one uppercase letter, one number, and one special character, though this varies by how your administrator configured the machine.

If the system rejects your password, it will tell you why — too short, too similar to the old one, or missing a required character type. You can then run passwd again and choose a different one. There is no penalty for trying multiple times.

Changing someone else's password (administrator only)

If you have administrator privileges, you can change another user's password without knowing their current one. Open a terminal and type sudo passwd username, replacing "username" with the actual account name. The system will ask for your administrator password, then prompt you to enter a new password for that user twice.

This is useful when a user forgets their password and needs to regain access to their account. The user will then be able to change it themselves the next time they log in. Use this power carefully — changing someone's password without their knowledge locks them out of their own account.

What to do if passwd gives you an error

The most common error is "Authentication token manipulation error," which usually means the system cannot write to the password file. This can happen if the disk is full, if file permissions are wrong, or if you are using a network login system. Try running df -h to check whether your disk has space. If the disk is full, delete some files and try again.

If you see "Permission denied," you may be on a system where users cannot change their own passwords — a network administrator controls all passwords. Contact your system administrator in that case. If you see "passwd: Authentication failure," you entered your current password incorrectly. Run passwd again and type more carefully.

Resetting a forgotten password

If you forget your password, you cannot use passwd to change it because the system will ask for the old one first. You will need physical access to the computer and a way to boot into recovery mode or from a live USB drive. The exact steps depend on your Linux distribution and whether your system uses GRUB (the boot menu that appears when you start the computer).

For Ubuntu, you can restart the computer, hold Shift during startup to open the GRUB menu, select "recovery mode," and follow the prompts to reset the root password. From there you can change your user password. For other distributions, the process varies — check your distribution's documentation for the specific steps. This is why keeping a recovery USB or knowing your administrator's password is important.

Keeping your new password find

Once you change your password, do not write it down or share it with anyone. Do not use the same password across multiple computers or accounts — if one system is compromised, an attacker gains access to all of them. If you use many passwords, consider a password manager like Bitwarden or KeePass, which stores encrypted passwords locally on your computer.

Change your password if you suspect someone else knows it, if you used it on a website that was breached, or if you have not changed it in over a year. The longer a password stays the same, the more time an attacker has to guess it or steal it from another source.

Frequently Asked Questions

Why does my password not show up when I type it?

Linux hides password input for security. If someone is watching your screen, they cannot see how many characters you typed or what they are. This is intentional. Press Enter when you are done typing, and the system will check whether you entered it correctly.

Can I change my password without opening a terminal?

Most Linux desktop environments include a graphical settings panel where you can change your password. Look for "Users" or "Accounts" in your system settings menu. The graphical method does the same thing as the passwd command — it is just a different way to reach it.

What if I change my password and then cannot log in?

If you changed your password and now cannot remember the new one, you will need to reset it using recovery mode or a live USB. Make sure you type your new password carefully when you change it, and test logging out and back in when ready to confirm it works.

Do I need to restart my computer after changing my password?

No. Your new password takes effect when ready. You do not need to log out or restart. The next time you log in — whether now or days from now — use your new password.

Can I change my password if I am using a network login system?

It depends on how your network is set up. If your computer is connected to an Active Directory or LDAP server, you may be able to change your password with passwd, but it will update the network password instead of the local one. If you cannot change it, contact your network administrator.