Skip to content

WSL - Issues Gen

Reset the password in Ubuntu / Linux Bash in Windows

Solution:

  1. Edit this file (in notepad or notepad++):

    %localappdata%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc\shadow

  2. 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:::

  3. Save the file

    Start Bash again with root privileges and set your password

    sudo bash
    passwd <your-user-name>

  4. You can now set a new password without having to enter the previous one.