5

I forgot my WSL Ubuntu password, needed to run sudo command. After running the folowing command

lead@kernel:~$ sudo su

I got this

Sorry, try again

Any alternatives? Thanks

4

1 Answer 1

6

I had the same problem. The first comment by @Ramhound solved it for me.

In the terminal outside of WSL:

  1. Run wsl -u root

Note: If you have more than one distribution then run wsl -d <your-distro-name> -u root instead of wsl -u root. with this command, you can choose a specific one. Replace <your-distro-name> with your distro name (For example: Ubuntu-22.04)

  1. Run passwd <username>

  2. Enter new password

1
  • Welcome to Super User! While it's "okay" to post an answer based on a comment, it's also usually considered "proper etiquette" to ask the user who posted the comment to do so. If not, we usually post it as a "Community Wiki" since the source was from someone else in the community. That may explain the downvote in this case (but we never know for sure). Note that @Ramhound specifically chose not to answer this because it was considered a duplicate of this question. Commented Apr 30 at 21:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .