Introduction
Forgetting a password is frustrating—but forgetting it inside Ubuntu running in Windows Subsystem for Linux (WSL) on Windows 11 can feel even worse. Unlike a typical Linux installation, where you might reset your password from a boot menu or recovery mode, WSL doesn’t give you the same options. That’s why many users panic when they realize they can’t log in.
- Introduction
- What is WSL in Windows 11?
- Step-by-Step Guide to Reset Ubuntu Password in Windows 11 WSL
- Step 1: Open Command Prompt
- Step 2: Switch Default User to Root
- Step 3: Launch Ubuntu as Root
- Step 4: List Available Users
- Step 5: Reset Password
- Step 6: Switch Back to Your User
- Frequently Asked Questions
- Q1: Can I reset my password without root access?
- Q2: Will resetting my Ubuntu password affect my Windows account?
- Q3: What if I forget my root password?
- Q4: Can I completely remove the password requirement?
- Q5: Does this method work for other Linux distros in WSL, like Debian or Kali?
- Conclusion
But here’s the good news: resetting your Ubuntu password in WSL is actually much easier than you think. All it takes is a few commands in Windows Command Prompt, and you’ll have your account back in minutes. No reinstalling Ubuntu, no losing data, and no complicated recovery process.
What is WSL in Windows 11?

WSL is a compatibility layer built by Microsoft that lets you run a real Linux environment directly on Windows—without needing a dual boot or a virtual machine. With WSL, you can install Linux distributions like Ubuntu, Debian, or Kali and run them almost natively inside Windows.
In Windows 11, WSL has become more powerful than ever:
- It supports WSL 2, which runs a lightweight virtual machine under the hood, giving you near-native performance.
- You can access Linux files from Windows and vice versa.
- It’s widely used by developers for Python, Node.js, Docker, and other Linux-based tools.
If you installed Ubuntu in WSL, Windows automatically created a user account for you during setup. That account is protected by a password, which is often required when you install packages or perform administrative tasks. Forgetting it can block your workflow—but thankfully, WSL’s flexibility makes recovery easy.
Step-by-Step Guide to Reset Ubuntu Password in Windows 11 WSL
Here’s the complete process broken down into simple steps. Don’t worry—it’s much easier than it looks.
Step 1: Open Command Prompt
Press Win + R, type cmd
, and hit Enter. This launches Command Prompt. Alternatively, you can search for “Command Prompt” in the Start Menu.
Step 2: Switch Default User to Root
Inside Command Prompt, enter the following command (replace (version)
with your installed Ubuntu version):
ubuntu(version) config --default-user root
Example: If the version number is 24.04, then the command will be as follows – ubuntu2204 config –default-user root
This sets root as the default user, which bypasses the need for a password.

Step 3: Launch Ubuntu as Root
Now open Ubuntu from the Start Menu. Since the default user is root, you’ll log in without entering a password.
Step 4: List Available Users
To see all users, run:
ls /home
This will show directories corresponding to each user account.

Step 5: Reset Password
Choose the username you want to reset, then run:
passwd (username)
Enter and confirm a new password when prompted.
Step 6: Switch Back to Your User
Once done, go back to Command Prompt and restore your original user as the default:
ubuntu(version) config --default-user (username)

Frequently Asked Questions
Let’s address some common questions users ask about resetting Ubuntu passwords in Windows 11 WSL.
Q1: Can I reset my password without root access?
No. You must either log in as root or temporarily switch the default user to root. That’s the only way to change another user’s password.
Q2: Will resetting my Ubuntu password affect my Windows account?
Not at all. WSL users and Windows users are completely separate. Changing one has no impact on the other.
Q3: What if I forget my root password?
In WSL, the root account doesn’t require a password by default. You can always switch to root using the Command Prompt method described earlier.
Q4: Can I completely remove the password requirement?
Yes, but it’s not recommended. You could set up sudo
to run without a password, but that weakens system security and increases risk of accidental damage.
Q5: Does this method work for other Linux distros in WSL, like Debian or Kali?
Yes! The process is nearly identical across distros. Just replace ubuntu(version)
with the correct distribution name (e.g., debian
, kali-linux
).
Conclusion
Forgetting your Ubuntu password in WSL can feel like a roadblock—but as you’ve seen, the solution is straightforward. By temporarily switching to the root user, you can reset any account password in just a few steps.