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.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 15 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
15 comments… add one
  • jj Aug 29, 2008 @ 5:47

    forgot how to reset user’s password, and found here from google serach. It’s working. thanks!


  • Mohamed yousuf Dec 12, 2008 @ 13:00

    I introduce myself as I dont have knowledge of linux systems .But I want to learn LINUX.
    I have a problem in a Digital Video Recorder Linux based embeded system which used HD for rrecording Video images.Os and applications are in the motherboard only.As I switch on the system, the screen shows INITIALISE and then the application starts itself.we cannot log into the admin of application to setup the system. The connected cameras are viewable.The user has lost or deleted the admin password.
    Please guide me how to solve the problem. The system is working as normal except the admin login .I dont know the version of LINUX operating system.Or I need ghosting of program from one good system(I have another machine in good working status with password.

  • how to reset user password Jan 19, 2010 @ 15:18

    i was going to reset the root password and it doesen’t work it was saying somthing like control-d command and i can’t type in “passwd best”

  • ping z Feb 3, 2010 @ 13:15

    i open help of yahoo site. i open how to change my password.
    it open the page but my cursur does not work, it doesn’t type a single letter.
    so many times i did it but it doesn’t go… please help.

  • DARREN j Jul 21, 2011 @ 16:47


  • xman Sep 24, 2011 @ 10:30

    thank you so much.
    i have a same problem.
    i resolved with your help.

  • Luis Alberto Sep 28, 2011 @ 1:46

    how to apply to multiple servers?

  • madhusudhakar Apr 16, 2012 @ 9:35

    Hello sir,
    This is XXX,I want kill other user’s processes in linux.
    Anyone having idea about this,pls send solution.
    Thx in advance……………………

  • shree Dec 11, 2012 @ 9:25

    their is no permissions to change the password even though if we change the password it gives changed successfully how come it can give in a normal user

  • mathu May 29, 2013 @ 14:16

    How to allow permissions linux users to change their password them self?

    i am unable to change the user password as a consign user id login.

    [czfgbw@umberla06 ~]$ passwd
    Changing password for user czfgbw.
    Changing password for czfgbw
    (current) UNIX password:
    passwd: Authentication token manipulation error

  • 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.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum