Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset the admin password for Ubuntu on Windows [closed]

I have Bash Ubuntu on Windows 10. This is enabled by turning on the Developer mode feature so the normal non-programmer would likely not need this. I need to reset the password. I must have typed it wrong (twice, somehow) when I first set it up. How can I do that?

like image 760
tom Avatar asked Jan 05 '23 03:01

tom


1 Answers

This has been answered HERE

Copying from their answer:

  1. In Windows command prompt change the default user to root:

    lxrun /setdefaultuser root

  2. Now Bash on Ubuntu on Windows logs you in as root without asking password

  3. Use passwd command in Bash to change the user password:

    passwd your_username

  4. Change the default user back to your normal user in Windows command prompt

    lxrun /setdefaultuser your_username

like image 136
Everyone Avatar answered Jan 07 '23 17:01

Everyone