WSL: Reset a User's Password
- Open PowerShell, then use the
wsl -u rootto run the next command as the
- At the prompt, enter
<username>is the account to change the password of, (e.g.
- Enter your password twice as prompted. It will not show in the terminal.
The password is now changed! Here's an example session using the username
PS C:\> wsl -u root [email protected]:/mnt/c/Users/current_user/# passwd current_user Enter new UNIX password: Retype new UNIX password: passwd: updated successfully [email protected]:/mnt/c/Users/current_user/# exit logout PS C:\>
Broader Topics Related to Reset the a user's password in Windows Subsystem for Linux (WSL)
Windows Subsystem for Linux (WSL)
Tips and tricks for using Windows Subsystem for Linux (WSL)