Ubuntu password issue

I did set my password as I installed Ubuntu some months ago, and now I have forgotten my password.

I can log in at start, but I can’t install updates anymore, also unable to run sudo command.
I tried to reset password but failed. Kindly help me to reset Ubuntu password.

Hey @uietcse1822monikayad !

You can try the steps below to reset the lost password. My other friend also had the same issue and this worked!

  1. Reboot your computer
  2. Press Shift during boot to start the GRUB menu
  3. Highlight your image and press E to edit
  4. Find the line starting with ‘linux’ and append ‘rw init=/bin/bash’ at the end of that line
  5. Press Ctrl+X to boot
  6. Type in password username
  7. Set your password
  8. Exit

Hope this helps! :grin:

1 Like


Which version of Ubuntu are you using? Please mention whether you’ve dual booted or using a virtual machine or using putty to access Digital ocean

Thank you @aksharakaul !
This really worked.

1 Like

I’m using virtual machine. Thanks for asking but my issue has been solved now.