WSL - Issues Gen¶
Reset the password in Ubuntu / Linux Bash in Windows¶
- AskUbuntu Question - Reset the password in Ubuntu / Linux Bash in Windows
- AskUbuntu - link to answer
Solution:
-
Edit this file (in notepad or notepad++):
%localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc\shadow
-
Find your normal user, for example:
user1:$jsdjksadgfhsdf.saflsdf.sadf.safd:17299:0:99999:7:::
and simply remove the hash part (below part)
$jsdjksadgfhsdf.saflsdf.sadf.safd
you will see a different hash - I hope :) so it should look like:
user1::17299:0:99999:7:::
-
Save the file
Start Bash again with root privileges and set your password
sudo bash
passwd <your-user-name>
-
You can now set a new password without having to enter the previous one.