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

WSL or Windows Subsystem for Linux is an essential ingredient of Windows 10 together with a boon for the developers who rely on whatever of the flavors of Linux to locomote their locomote done. However, it has ever been a employment to get create users ane time the administrator employment concern human relationship has been prepare at the startup. In this article, nosotros volition hold upwards checking out how to laid default user, switch user, together with take a user on a Windows Subsystem for Linux distro on Windows 10.

 together with a boon for the developers who rely on whatever of the flavors of Linux to locomote their locomote d How to laid default user, switch user, together with take a user for WSL

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

We volition hold upwards roofing the next procedures inwards this guide:

  1. How to laid default user for WSL
  2. How to  switch user for WSL
  3. How to take a user for WSL.

1] Set default user for WSL

When yous opened upwards a WSL Distro on your Windows 10 computer, it starts signing yous into a detail default user account. You tin alter this default user if yous want. You postulate to opened upwards Command Prompt or Powershell alongside Administrator degree rights.

 together with a boon for the developers who rely on whatever of the flavors of Linux to locomote their locomote d How to laid default user, switch user, together with take a user for WSL

Now execute the next commands for the several Linux distros:

Ubuntu: 

ubuntu config --default-user <USERNAME>

Ubuntu 18.04 LTS:

ubuntu1804 config --default-user <USERNAME>

Ubuntu 16.04 LTS:

ubuntu1604 config --default-user <USERNAME>

openSUSE Leap 42:

openSUSE-32 config --default-user <USERNAME>

SUSE Linux:

SLES-12 config --default-user <USERNAME>

Debian: 

debian config --default-user <USERNAME>

Kali Linux:

kali config --default-user <USERNAME>

You tin also replace <USERNAME> to ROOT  if yous desire to laid the default user to ROOT.

2] Switch user inwards WSL

When yous opened upwards a WSL distro, the ascendency trace automatically logs yous into the default user nosotros talked b. But if yous desire to switch user to roughly other user account, it is fairly unproblematic too.

 together with a boon for the developers who rely on whatever of the flavors of Linux to locomote their locomote d How to laid default user, switch user, together with take a user for WSL

Open the distro’s rootage location. Type inwards ane of the next commands to switch to a detail user:

su - <USERNAME>su -l <USERNAME>su --login <USERNAME>

You volition bring to replace <USERNAME> with the raise of the user employment concern human relationship within the distro that yous desire to log into.

3] Remove a user inwards WSL

In this case, in that location volition hold upwards 2 scenarios. One volition hold upwards where yous are logged inwards equally a SUDO user together with the other ane where yous are logged inwards equally ROOT. We volition hold upwards roofing both of these scenarios.

  • When logged inwards equally a SUDO user.
  • When logged inwards equally a ROOT user.

When logged inwards equally a SUDO user:

 together with a boon for the developers who rely on whatever of the flavors of Linux to locomote their locomote d How to laid default user, switch user, together with take a user for WSL

You postulate to execute the next ascendency when yous are logged inwards equally a SUDO user together with desire to delete a User employment concern human relationship within the same Linux distro:

sudo deluser <USERNAME>

When logged inwards equally a ROOT user: 

And if yous are logged inwards equally ROOT, the method is slightly different. First, yous postulate to refer to the higher upwards direct to laid a default user. This default user volition hold upwards the ane that yous desire to remove. Then, yous postulate to execute the next ascendency to delete a user inwards the same Linux distro:

deluser <USERNAME>

It is worth making certain that the <USERNAME> must hold upwards same equally the user employment concern human relationship yous made the default user.

Hope this helped.


Source: https://www.thewindowsclub.com/

No comments

Theme images by lobaaaato. Powered by Blogger.