Linux: Resetting a user’s password

Q. How do I reset a user’s password under any Linux distribution from command prompt?


A. To reset a user’s password, use passwd command. You have to change it to a different password.

Login as the root user

Open terminal or shell prompt

Type the following command:
# passwd username
For example, reset a tom’s password, enter:
# passwd tom
Type a new password twice.

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

15 comments… add one
  • Spufii Jun 4, 2013 @ 20:26

    I have run into an issue with forcing a user to change their password on first login onto a server where the user logs onto the server they are asked to enter their old password, then the new one. When they enter the new one, no matter what password they use, an message appears that states their password is a dictionary word and will not let them change it.
    Is there a way to fix this??

  • hog242 Jun 20, 2013 @ 15:39

    Just type “passwd” without ” and follow on screen instructions

  • joffre May 29, 2014 @ 22:45

    hey I did the procedure but the system replied saying there is a TOKEN conflict, ……. so I asked to myself…… what is this #%”#%, anybody please help!!! this is a call to the geek world!!!

  • bryan Jun 13, 2014 @ 6:50

    I am not able to change the password, and since i cannot update (cause i need the password) I’m pretty much stuck, I got this laptop as a gift and the person who gave it to me forgot the admin password, and he deleted all updates and such, it’s so bad that not even flash player from adobe is installed, I need urgent help. I tried the things above but i am not able to type after i finally get to change the password, it just says its a token error. HELP

  • Devon Sep 5, 2015 @ 4:21

    Nice! but do you know how to reset root password as normal user?

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.