WSL Tips and Tricks

Reset Root User's Password

  1. Open PowerShell, then use the wsl -u root command to change the password.
  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
[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 Windows Subsystem for Linux (WSL)

Linux

A free and open-source operating system

Microsoft Windows

The Microsoft Windows Operating System

Windows Subsystem for Linux (WSL) Knowledge Graph