I am using WSL on Windows 11 with Ubuntu 20.04 LTS (Focal Fossa).
During the installation process, I think I entered the command ubuntu --install
(in VSCode), but I ran into an issue during the installation. The terminal opened, asking for a Linux user and password, but then it closed as some other application started or something.
Since I never got the chance to set my default user's password, I opened CMD, and, if I remember correctly, used the command ubuntu config --default-user root
. Then I returned to the Ubuntu shell and entered a command to reset my Linux password.
At this point I had not even used my VSCode. However, when I open VSCode, it still seems to be in the root user's account.
I used mkdir
to create a folder without realizing I was still in root, as shown below:
root@Lokrheim:~/folder#
When I type exit
, the shell just closes, as if it is exiting the application rather than the root user's login. No matter what I do, my VSCode still remains as a root user.
How can I access my non-root user in Ubuntu on WSL?