Resetting WSL password
15/4/2023
One-minute read
Working on WSL after leaving it for a while, could be such a great lesson for you! I recently forgot my password and found out that there is a way to recover it easily.
Here is the solution:
Change user to root.
ubuntu config --default-user root
For this, you might have a different run command for Ubuntu. which you can find in the reference but it’s like the next:
- Kali for Kali
- ubuntu 2004 for Ubuntu 20.04
- and so on
Set user password.
here you need to open your WSL and set the password like Linux:
passwd username
Change back to the default user.
ubuntu config --default-user USERNAME
Horay!
Helpful resources: