Go to TogaWare.com Home Page. GNU/Linux Desktop Survival Guide
by Graham Williams
Duck Duck Go

WSL Reset Password

20190509 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 Ubuntu 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

Figure 4.1: Process for changing user password in Ubuntu under WSL.
Image wsl-change-password

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 $.

Copyright © 1995-2019 Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware and the author of open source software including Rattle and wajig.
Also the author of Data Mining with Rattle and Essentials of Data Science.