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:
- Open a Command Prompt as Administrator. You can do that by typing cmd in the Start menu and pressing CTRL+Shift+Enter.
ubuntu config --default-user root
- 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
- Now you can reset any user’s password by entering
- Finally, exit bash, and in the elevated Command Prompt, type
ubuntu config --default-user myuserto change the default bash login to your bash user.