To change the Linux password
To change your Linux password, in the Linux terminal execute
passwd
You will be asked for the current password and the new password.
If you forgot the Linux password
If you forgot your Linux password, you can reset it from Windows.
- In Windows PowerShell enter the Linux distribution root account with the command
wsl -u root
- If you have multiple Linux distributions in your WSL, specify the distribution name too
wsl -d <DistroName> -u root
- Once the Linux root level access opened, change the password of the user with
passwd <username>