

I hope this was helpful to you and you were able to reset the password of your Linux distribution in WSL. I gave you the commands and explained the steps.

If someone already has this much access, they can do much more than just change the Linux password in WSL.
#KALI LINUX PASSWORD WINDOWS#
You need physical access to the computer and access to the Windows account. If resetting WSL password is this easy, is this not a security risk? If you forgot the password again in the future, you know the steps to reset it. You have reset the password fresh and can use it to run commands with sudo. Now when you start your Linux distribution app in WSL, you’ll be logged in as a regular user. ubuntu config -default-user username Set regular user as default user However, this time, replace root with the regular user. Use your distribution’s command in the similar manner you did in step 1. Start the Windows command prompt once again. You’ll need the regular account username that you used with the passwd command in the previous step. Step 3: Set regular user as default again You should change it back to your regular account user, otherwise, it will keep on logging in as the root user. The password for the user account has been reset. Reset the password for the regular userĬongratulations. You’ll have to retype the new password to confirm and once again, nothing will be displayed on the screen while you type the password. Just type the new password and hit enter. When you type here, nothing will be displayed on the screen.

When you have the username, use this command: passwd username You can reset the password for the normal user account.ĭo you remember the username in WSL? If not, you can always check the contents of the /home directory. Now, if you start the Linux distribution app, you should be logged in as root. Step 2: Reset the password for the account To save you the trouble, I am listing some distributions and their respective commands in this table: Distribution App Set root as default user in Linux app’s configuration In the screenshot, I am using Ubuntu 20.04 app from the Windows store. If you were using the Ubuntu app from Windows store, the command would be: ubuntu config -default-user root In here, use your distribution’s command in this fashion. Know the command to run for your distribution appįrom the Windows menu, start the command prompt: Start Command Prompt This is from where you had downloaded your distribution in the first place. This information is usually provided in the description of the distribution app in the Windows Store. This is done through Windows Command Prompt and you’ll need to know which command you need to run for your Linux distribution. Since you don’t remember the account password, switching to the root user is done by changing the configuration of your Linux WSL application and make it use root user by default. This means that you can switch to the root user and then use the power of root to reset the password.

The root user in WSL is unlocked and doesn’t have a password set. As you can see, my regular account’s username is abhishek. It will be wise to note down your account’s normal/regular username. Subscribe to our YouTube channel for more Linux videos Step 1: Switch to root as default user
