DEV Community

Ethan R
Ethan R

Posted on

2

Resetting the password of an Ubuntu on Windows installation

I installed Ubuntu on Windows quite a while ago, and today I found myself unable to remember the password I had used. It happens, and considering this isn't a bank account or a nuclear missile, I figured it shouldn't be too hard to reset the password. And good news, it isn't.

Resetting your password

  1. Take note of your username on Ubuntu. You'll need this later.

  2. In the Windows (admin) command line enter:
    ubuntu config --default-user root

  3. Load up Ubuntu with the ubuntu command. It should now show you as the root user. Now within Ubuntu enter:
    passwd <your ubuntu username>

  4. You'll be prompted to change your password. Go through the prompt and set your desired password, then exit from Ubuntu with the exit command.

Congrats, you're done. Now you'll probably want to set your user back to being the default user. Just run this in the Windows command line:
ubuntu config --default-user <your ubuntu username>

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

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

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

Okay