Resetting Windows 10 bash user password

If you have forgotten your bash user password on Windows 10, there is a way to log in as root to reset that user’s password using passwd.

First, make sure all bash windows are closed. This is important as if one bash instance is open, this may not work:

  1. Open a Command Prompt as Administrator. You can do that by typing cmd in the Start menu and pressing CTRL+Shift+Enter.
  2. Run: ubuntu config --default-user root
  3. The previous command tells bash to log in as root the next time it’s started. So you can now run a rooted bash by typing bash.
  4. Now you can reset any user’s password by entering passwd myuser
  5. Finally, exit bash, and in the elevated Command Prompt, type ubuntu config --default-user myuser to change the default bash login to your bash user.

Leave a Reply