4.14 WSL Reset Password


It is relatively simple to reset your user password on your Ubuntu system under WSL. This is useful if you have forgotten the password and need to perform some system administration operations on Ubuntu.

To reset your Ubuntu user account password, start up a PowerShell (Super+X, A) and configure the Ubuntu instance (ubuntu1804) to log in by default as the root (admin) user:

> ubuntu1804 config --default-user root

Then start up Ubuntu as normal. Here we simply start it up from the PowerShell command line:

> ubuntu1804

Now change your user (e.g., the user kayon) password:

# passwd kayon
Enter new UNIX password: 
Retype new UNIX password: 

Then logout of Ubuntu and reconfigure the default user:

# logout
> ubuntu1804 config --default-user kayon

Process for changing user password in Ubuntu under WSL.

Notice that the command line prompts in the above examples differ depending on which system is interpreting the commands. The “greater than” prompt > is for the PowerShell whilst the hash prompt # is for the root user on Ubuntu. For a normal user on Ubuntu the prompt is usually a dollar sign $.

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0