WSL: Reset a User's Password

On Windows Subsystem for Linux, you can reset a user's password using the --user (or -u) flag to run the passwd Linux command as the specified user.

  1. Open PowerShell, then use the wsl -u root to run the next command as the root user.
  2. At the prompt, enter passwd <username> where <username> is the account to change the password of, (e.g. passwd james).
  3. 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 current_user:

PS C:\> wsl -u root
root@COMPUTER:/mnt/c/Users/current_user/# passwd current_user
Enter new UNIX password:
Retype new UNIX password:
passwd: updated successfully
root@COMPUTER:/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)

Windows Subsystem for Linux (WSL)

Tips and tricks for using Windows Subsystem for Linux (WSL)

Reset the a user's password in Windows Subsystem for Linux (WSL) Knowledge Graph