To change your password in Linux, you can use the passwd
command.
Here are the steps on how to change your password in Linux:
- Open a terminal window.
- Type the following command:
passwd
- The command will prompt you to enter your current password.
- Enter your current password and press Enter.
- The command will then prompt you to enter your new password.
- Enter your new password and press Enter.
- The command will then prompt you to enter your new password again to confirm.
- Enter your new password again and press Enter.
- The command will change your password.
Here is an example of how to change your password in Linux:
[user@localhost ~]$ passwd
Changing password for user user.
Enter old password:
Enter new password:
Retype new password:
passwd: password updated successfully
To change another user’s password in Linux, you can use the following command:
sudo passwd username
Here is an example of how to change another user’s password in Linux:
[user@localhost ~]$ sudo passwd abhi
Changing password for user abhi.
Enter the new password for abhi:
Retype the new password for abhi:
passwd: password updated successfully

I’m Abhishek, a DevOps, SRE, DevSecOps, and Cloud expert with a passion for sharing knowledge and real-world experiences. I’ve had the opportunity to work with Cotocus and continue to contribute to multiple platforms where I share insights across different domains:
-
DevOps School – Tech blogs and tutorials
-
Holiday Landmark – Travel stories and guides
-
Stocks Mantra – Stock market strategies and tips
-
My Medic Plus – Health and fitness guidance
-
TrueReviewNow – Honest product reviews
-
Wizbrand – SEO and digital tools for businesses
I’m also exploring the fascinating world of Quantum Computing.
[…] how change user password in Linux with proper example […]