How to set default user, switch user, and remove a user for WSL

WSL or is an integral part of Windows 10 and a boon for the builders who depend on any of the flavors of Linux to get their work achieved. However, it has all the time been a drawback to handle customers as soon as the administrator account has been set up on the startup. In this text, we will probably be trying out how to set default user, switch user, and remove a user on a Windows Subsystem for Linux distro on Windows 10.

svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3 - How to set default user, switch user, and remove a user for WSL

Set default user, switch user, remove a user for WSL

We will probably be overlaying the next procedures on this information:

  1. How to set default user for WSL
  2. How to  switch user for WSL
  3. How to remove a user for WSL.

1] Set default user for WSL

When you open a WSL Distro in your Windows 10 pc, it begins signing you into a explicit default user account. You can change this default user if you need. You want to open or with Administrator degree rights.

svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3 - How to set default user, switch user, and remove a user for WSL

Now execute the next instructions for the a number of Linux distros:

Ubuntu: 

ubuntu config --default-user 

Ubuntu 18.04 LTS:

ubuntu1804 config --default-user 

Ubuntu 16.04 LTS:

ubuntu1604 config --default-user 

openSUSE Leap 42:

openSUSE-32 config --default-user 

SUSE Linux:

SLES-12 config --default-user 

Debian: 

debian config --default-user 

Kali Linux:

kali config --default-user 

You may also change  to ROOT  if you need to set the default user to ROOT.

2] Switch user in WSL

When you open a WSL distro, the command line robotically logs you into the default user we talked b. But if you need to switch user to one other user account, it’s pretty easy too.

svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3 - How to set default user, switch user, and remove a user for WSL

Open the distro’s root location. Type in one of many following instructions to switch to a explicit user:

su - 

su -l 

su --login 

You can have to change  with the title of the user account contained in the distro that you really want to log into.

three] Remove a user in WSL

In this case, there will probably be two situations. One will probably be the place you’re logged in as a SUDO user and the opposite one the place you’re logged in as ROOT. We will probably be overlaying each of those situations.

  • When logged in as a SUDO user.
  • When logged in as a ROOT user.

When logged in as a SUDO user:

svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3 - How to set default user, switch user, and remove a user for WSL

You want to execute the next command if you find yourself logged in as a SUDO user and need to delete a User account inside the identical Linux distro:

sudo deluser 

When logged in as a ROOT user: 

And in case you are logged in as ROOT, the strategy is barely completely different. First, you want to refer to the above information to set a default user. This default user would be the one that you really want to remove. Then, you want to execute the next command to delete a user in the identical Linux distro:

deluser 

It is price ensuring that the have to be identical because the user account you made the default user.

Hope this helped.

Leave a Comment