Skip to main content

How to reset SUDO password of ubuntu on WSL [STEP BY STEP GUIDE]

Hello everyone,

I just found out a super easy way to reset the password of Ubuntu installed on your windows PC.




Step 1: Know your username

your ubuntu username can be found by various ways. the easiest method is to run the $whoami command on Ubuntu terminal to get your username.


Here my username is chamodhk


Step 2: Reset the password

Now close your Ubuntu terminal and open windows command prompt and run the command 

wsl -d Ubuntu -u root





now you have logged in as the root of the Ubuntu system and now type the following command.

passwd <your_username>

in this command replace the <your_username> part with your actual username. In my case, the command is passwd chamodhk



That's it. Follow the on-screen instructions to create your new password.


Don't forget to leave a comment :)

bye.






Comments