The fastest way: use passwd at the command line

Open a terminal and type passwd, then press Enter. Linux will ask you to type your current password once, then your new password twice. That is the entire process — no flags, no options needed.

The system will not show the characters as you type. This is normal and intentional. Type carefully, because a typo in your new password means you will have to start over. If the two new passwords do not match, passwd will tell you and let you try again.

After you press Enter the second time, you will see a message like "password updated successfully" or similar. Your new password takes effect when ready. You do not need to restart or log out.

Key Takeaways

  • Type passwd at the command line, then enter your current password and your new password twice.
  • The system will not display what you type — this is normal security behavior, not a malfunction.
  • If your new passwords do not match, passwd will reject them and let you try again without losing your current password.
  • Your new password works when ready; you do not need to log out or restart the system.
  • If you forget your new password before you finish typing it, close the terminal and start over — your old password is still active.

What to do if passwd says "authentication failure"

This message means you typed your current password incorrectly. Type passwd again and re-enter your current password. Remember that passwords are case-sensitive — capital A is different from lowercase a.

If you have tried several times and you are certain your current password is correct, you may have Caps Lock on. Press Caps Lock to turn it off and try again. If you genuinely cannot remember your current password, you will need to use a different method — see the section below on resetting a forgotten password.

Changing another user's password (if you have root access)

If you are the system administrator or have sudo privileges, you can change another user's password without knowing their current one. Type sudo passwd username, replacing "username" with the actual account name. You will be asked for your own password (to confirm you have sudo rights), then you can set a new password for that user.

The user will not be locked out of their account during this process. Their old password stops working when ready, and they can log in with the new one right away. This is useful if a user has forgotten their password and you need to reset it for them.

Resetting your password if you have forgotten it

If you cannot log in because you forgot your password, you will need physical or remote access to the machine and the ability to restart it. Restart the system and watch for the boot menu — usually you can press Escape, Shift, or a function key during startup to see options.

Look for an option to enter single-user mode, recovery mode, or GRUB menu. The exact name and key depend on your Linux distribution. Once in recovery mode, you will usually have a root prompt without needing a password. Type passwd username to reset that user's password, then restart normally.

If your system is encrypted or uses a bootloader password, this method will not work — you may need to contact your system administrator or the person who set up the machine. If this is a work computer, contact your IT department.

Making your new password stronger

Linux does not enforce password strength rules by default, but many systems are configured to reject weak passwords. If passwd tells you your password is "too straightforward" or "based on a dictionary word," try a combination of uppercase letters, lowercase letters, numbers, and symbols.

A strong password is usually at least 12 characters long and does not contain your username, your real name, or common words. Avoid patterns like "Password123" or "Qwerty456" — these look random but are among the first things attackers try.

Changing your password on a remote server via SSH

If you are logged into a remote Linux server through SSH, the process is identical: type passwd and follow the same steps. Your terminal may look different, but the command works the same way on any Linux system.

After you change your password, your next SSH login will use the new password. Your current SSH session stays open — you do not need to disconnect and reconnect.

Frequently Asked Questions

Why does the password not show as I type?

Linux hides passwords for security — if someone is looking over your shoulder, they cannot see how many characters you typed or what they are. This is standard behavior on all Unix-like systems and is intentional, not a bug.

Can I change my password without opening a terminal?

Most desktop Linux systems have a graphical settings panel where you can change your password. Look for "Users," "Accounts," or "System Settings" in your process menu. You will still need to enter your current password to confirm the change, just like at the command line.

What if I change my password and then forget the new one when ready?

If you have not closed the terminal yet, you can type passwd again and change it to something you will remember. Your old password is no longer active, so you cannot go back to it. If you have already closed the terminal and logged out, you will need to use recovery mode to reset it.

Does changing my password affect my SSH keys?

No. SSH keys and passwords are separate authentication methods. Changing your password does not affect any SSH keys you have set up. If you use key-based login, your password change will not interfere with it.

How often should I change my password?

There is no universal rule. Change it if you think someone may have seen it, if you use the same password on multiple systems, or if your system administrator requires it. Changing it every 30 days is outdated information — a strong password changed once is better than a weak password changed often.