DEV Community

Ethan R
Ethan R

Posted on

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>

Oldest comments (0)