DEV Community

kosei
kosei

Posted on • Edited on • Originally published at qiita.com

How to Reset Your User Password in Ubuntu on WSL if You Forget It

Introduction

After a long time, I tried to launch WSL and sudo on Ubuntu, but I forgot the password.

Reset Method

Log in as root with the following command.

wsl -u root
Enter fullscreen mode Exit fullscreen mode

Enter the username you want to reset in place of [username] in the following command.
You will be prompted for a new password, so reset it.

passwd [username]
Enter fullscreen mode Exit fullscreen mode

Top comments (0)