root access to [WSL] Windows Subsystem for Linux

© 2022 www.JaxBeachTech.com  |  Ph: 9o4.834.o433  |   email  |  [50.41]

Submitted by admin on Fri, 11/08/2019 - 11:38

Firstly - set the default user to be "root" like this:
At at CMD prompt with Administrator rights:
C:\WINDOWS\system32>ubuntu config --default-user root

Then open WSL and run:
# passwd defaultuser
To set the password for your preferred user (in example: "defaultuser")

Then, 
At at CMD prompt with Administrator rights:
C:\WINDOWS\system32>ubuntu config --default-user defaultuser

And then restart your WSL.  
Thereafter use the passwd you set above for "defaultuser" above when you run a "sudo" command...