How to reset a forgotten Ubuntu password

Written by Ian Carnaghan · 27 sec read >
  • Boot up your System
  • When the Grub screen appears choose “Ubuntu x.xx, kernal x.x.x-xx-generic (recovery mode)”. The x’s are in the place of the version numbers
  • On the next screen select “Drop to root shell prompt”
  • Once in the root shell prompt use the passwd command to reset your password
    password USERNAME

    Replace USERNAME with the username who’s password you need to reset

  • Next enter the following commands to force changed blocks to disk and reboot the System
    reboot -f

    sync = Writes any data buffered in memory out to disk and ensures that everything in memory is written to disk.
    reboot -f = Reboots the system-f forces the system to reboot

  • After the reboot, you should be able to login with the new password.

Last Updated On April 07, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

Notify of