How to Reset Forgotten Password in Linux

Download Article
Easily access your Linux device by changing your password with this simple guide
Download Article


So you forgot your Linux/Ubuntu/Unix password? No worries, this article will guide you how to reset your Linux password in minutes.

  1. How.com.vn English: Step 1 Boot into recovery mode.
    While your computer is booting, from the boot menu select the "recovery mode" option.
    • Press F8 key in case boot menu doesn't appear.
      How.com.vn English: Step 1 Boot into recovery mode.
  2. How.com.vn English: Step 2 Select the option 'Drop to root shell prompt'.
    After the computer boots in to recovery mode, from the Recovery menu select the option 'Drop to root shell prompt'
    Advertisement
  3. How.com.vn English: Step 3 Type the command.
    To change the password type the command 'passwd username' and follow the instruction below.
  4. How.com.vn English: Step 4 In case of error.
    There is a possibility that you may get an 'Authentication token manipulations error' as Filesystem state could be 'Read only'. To fix it, type the following command before the first command. mount -rw -o remount
  5. Advertisement

Community Q&A

Search
Add New Question
  • Question
    What do I do if the computer won't accept commands after selecting the "Drop to root shell prompt' option?
    How.com.vn English: Haxalicious
    Haxalicious
    Community Answer
    You need to mount the filesystem as read-write (rw). Do step 4 and type "mount -rw -o remount". You can also go into the recovery menu first, select "fsck" which will mount your filesystem as rw (and it will also check the disk for errors too) and after that you can use the root shell.
  • Question
    Will it lose my memory?
    How.com.vn English: Community Answer
    Community Answer
    If you are referring to data in your hard disk, there is no data to lose. You are just modifying the file /etc/passwd file by the above-mentioned step.
  • Question
    How do I protect my computer from this attack?
    How.com.vn English: Community Answer
    Community Answer
    Inside a terminal, type sudo nano /etc/default/grub. After finding #GRUB_DISABLE_RECOVERY="true", uncomment that line. Then, exit the nano text editor (make sure to save changes).
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 115,884 times.
      How helpful is this?
      Co-authors: 5
      Updated: August 24, 2022
      Views: 115,884
      Categories: Linux
      Thanks to all authors for creating a page that has been read 115,884 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement