GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
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 |
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 $
.