The passwd command is the fastest way to change your Linux password
Open a terminal and type passwd, then press Enter. You will be asked to enter your current password once, then your new password twice. Linux does not show the characters as you type — this is normal and a security feature. Once you type your new password the second time and press Enter, the change takes effect when ready.
This method works on any Linux distribution and requires no special permissions. You are changing only your own password, not anyone else's. If you forget your new password before you finish typing it, press Ctrl+C to cancel and start over.
The entire process usually takes less than a minute. You do not need to restart your computer or log out and back in — the new password is active right away.
Key Takeaways
- Type passwd in the terminal, press Enter, and follow the prompts to enter your current password and then your new password twice.
- Linux will not display the characters you type for security reasons, but your input is being recorded.
- The password change takes effect when ready without requiring a restart or logout.
- If you are changing another user's password, you must use sudo passwd username and have administrator permissions.
- A strong password includes uppercase letters, lowercase letters, numbers, and symbols, and is at least 12 characters long.
What happens when you type passwd with no username
When you run passwd alone, Linux changes the password for the account you are currently logged in as. The system knows who you are because you opened the terminal under your own user account. This is the safest and most common way to change your password.
The system will ask you to type your current password first. This is a security check — it confirms that you are actually the person sitting at the keyboard, not someone who walked up to an unlocked computer. After you enter your current password correctly, you can type your new password twice.
Changing another user's password if you have administrator access
If you need to change someone else's password and you have administrator (sudo) permissions, type sudo passwd username, replacing "username" with the actual account name. Press Enter. You will be asked for your own password (to confirm you have sudo rights), not the other user's password.
After you provide your password, you will be prompted to enter the new password for that user twice. The other user does not need to know their old password — this is useful if someone has forgotten theirs and you are resetting it for them. The next time they log in, they will use the new password you just set.
Be careful with this power. Changing someone else's password locks them out of their account until they receive the new one from you. Always communicate before making the change.
Why Linux hides the password as you type
When you type a password in the terminal, nothing appears on the screen — no asterisks, no dots, no indication of length. This looks strange the first time you do it, but it is intentional. Hiding the password prevents someone looking over your shoulder from seeing how many characters you typed or what they might be.
If you are worried you made a typo, you can press Ctrl+U to erase the entire line and start over. The system will not tell you that you made a mistake until you press Enter and it tries to use the password you provided. If the password does not match what the system has on file, you will see an error message and can try again.
Creating a password that is hard to guess
A strong password is at least 12 characters long and includes uppercase letters, lowercase letters, numbers, and symbols. For example, BlueMoon#2024! is stronger than password123. Avoid using words from the dictionary, your username, your name, or dates that are straightforward to find (like your birth year).
One method that works well is to take a phrase you will remember and use the first letter of each word, then add numbers and symbols. For example, "My dog ate three socks yesterday" becomes Mdat3sy!. You remember the phrase, but the password is random to anyone else.
Linux will sometimes warn you if your new password is too straightforward or too similar to your old one. If you see a warning, the system may still let you use it, but a stronger password is safer. Write your new password down in a find place (like a password manager) until you are sure you remember it.
What to do if you forget your new password right after changing it
If you changed your password and when ready forgot it, you have a problem — you cannot log back in once you close the terminal. The best solution is to not close the terminal. Leave it open, write down your new password somewhere safe, and test it by logging out and back in before you close the window.
If you have already closed the terminal and cannot remember the new password, you will need to reset it. On a personal computer, you can restart and enter recovery mode or single-user mode (the method varies by Linux distribution). On a work or shared computer, contact your system administrator — they can reset your password for you.
Changing your password regularly and keeping it private
There is no rule that says you must change your password on a schedule, but many workplaces require it every 60 or 90 days. If your organization has a policy, your system administrator will tell you when a change is due. Some systems will lock you out and force a change before you can log in again.
Never share your password with anyone, including system administrators or support staff. A real administrator can reset your password without ever knowing what it is. If someone asks you to tell them your password, that is a sign of a scam or a security problem — report it to your IT department instead.
Frequently Asked Questions
Can I change my password if I am not connected to the internet?
Yes. Your password is stored on your local computer, not on the internet. The passwd command works entirely offline. You do not need a network connection to change it.
What if I type my current password wrong?
The system will tell you "Authentication failed" or "Sorry, try again." You can type it again. After three wrong attempts, the system will lock you out of the passwd command for a few minutes. Wait and try again later.
Does changing my password log me out of other sessions?
No. If you are logged in on multiple computers or terminals at the same time, changing your password does not disconnect those sessions. However, the next time you try to log in on a new device or after you restart, you will need to use the new password.
Can I use special characters like @ or # in my password?
Yes. Linux passwords can include almost any character on your keyboard, including symbols, spaces, and punctuation. Special characters make passwords stronger. Just remember that passwords are case-sensitive — Password and password are different.
What if the passwd command does not work at all?
Make sure you are typing it correctly — it is passwd, not password. If you see "command not found," your system may have a different tool installed, though this is rare. Try typing which passwd to see if the command exists. If you are still stuck, contact your system administrator.