How to Change Kali Linux’s Default User to Root in WSL

After installing a couple of Kali distros in WSL in Windows, I often bumped into below error messages when I was trying to use sudo as a non-root user:

Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts

Since this is an extremely anonying behavior, which seems to be typical only for the WSL version of Kali, I decided to use root as the default user and below is how I did it in Windows’ command line or Powershell.

kali config --default-user root

 Also, another way to do this is to update your Windows Terminal’s profile like below:

wsl.exe -d kali-linux -u root`

 

 


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *