I have installed Linux Bash on Windows 10 (available from Microsoft), but I've forgotten my password.
I've searched for a solution but I only find suggestions that involve doing something before the system boots, like accessing recovery mode, but that will not work in this case as this Ubuntu is just an application within a Windows system and doesn't have its own boot process.
How can I reset my password?
Best Answer
bash
and make a note of your Linux username (this need not match your Windows username), see How can I find out my user name?In Windows admin command prompt (Super+X, A) change the default user to root:
If you are using Ubuntu 18.04 in WSL, the command has changed to
ubuntu1804
, soUse
passwd
command in Bash to change the user password (the user whose password you want to reset):Change the default user back to your normal user in Windows command prompt
If you are using Ubuntu 18.04 in WSL, the command has changed to
ubuntu1804
, soWatch Full Video to Recover your password Windows Subsystem Linux https://youtu.be/dTR232yvDCE
Note 1: The subsystem used in the video is not Ubuntu, but Kali Linux. Hence the difference in the command.
Note 2: If you are still using the original Ubuntu subsystem that came with the Anniversary Update, use the command lxrun. Upgrade to the subsystem version distributed via Microsoft Store is recommended.)