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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay