Table of Contents
This practical guide walks through how to reset WSL user password, explains the main requirements, and highlights common issues that may appear along the way.
Use root account
A simple way to recover or reset forgotten passwords for WSL users is to use the root account. In most WSL distributions, the root account is enabled and no password is required.
Since WSL automatically logs in to the default account set without a password prompt, you can change the configuration file and set the default account as the root account.
To change the configuration, it is necessary to use the WSL version executable. By default, the executable is located in
C:usersusernameappdataLocalMicrosoftWindowsApps.
Replace username with your user account name and distroname with your WSL distribution. For example, the openSUSE 15.3 Leap executable would be
C:UsersmteAppDataLocalMicrosoftWindowsAppsopenSUSE-Leap-15.3.exe.
To change the configuration for the distribution, launch the Command Prompt and enter the command that matches the name of your distribution. For example, for openSUSE, set the default user to root with the command:
opensuse-leap-15.3 config --default-user root
The above command will change the default user to root for the WSL openSUSE instance.
For other distributions, the command would be:
Ubuntu
ubuntu config --default-user root
Ubuntu 18.04
ubuntu18004 config --default-user root
Ubuntu 20.04
ubuntu2004 config --default-user root
Kali Linux
kali config --default-user root
Debian
debian config --default-user root
Arch Linux
arch config --default-user root
The final step is to login to the distribution and change the password for the target username. You can launch your distro using the Start menu, Command Prompt, or selecting it from the Windows Terminal.

After launching, you should log in as root.
Finally, use the passwd command to change the password. For example, to change the password for username cap, set the command as:
passwd cap
Restore default user
After you reset the password for a specific user, it is best to change the default user instead of using the root account.
To do that, use the config command and replace username with the desired account. Eg:
opensuse-leap-15.3 config --default-user cap
Remember to replace it with your distribution's name.
Hope you are succesful.
Key Takeaways
Use the information above as a practical reference for how to reset WSL user password. Review each step carefully, confirm any requirements, and choose the option that best fits your situation.
FAQ
What does this guide explain about Reset WSL User Password?
It explains the main concepts, practical considerations, and useful steps related to reset WSL user password without requiring advanced knowledge.
Who can benefit from learning about Reset WSL User Password?
This information is useful for readers who want a clear overview, practical guidance, and reliable steps related to reset WSL user password.
What should I check before applying this information?
Review the requirements, confirm that your device, software, or situation matches the instructions, and back up important data before making major changes.
Reader Comments 0
Sign in with email or Google to join the discussion.