Ever since the inception of Windows 10, Microsoft has shown their special fervour for Linux. It has been trying to bring Linux in its ecosystem. In the following tutorial, we will show you how to add and switch users in Windows Subsystem for Linus. This Windows Subsystem for Linux has been ameliorated in Windows 10 Creators Update.
To Add & Switch Users In Windows Subsystem For Linux
1. If you want to add a new user, first open Ubuntu on Windows 10. Now type the following command and hit Enter.
sudo adduser mynewuser
Now that you have entered the command, enter the password for your current Linux user account in order to create a new user.
After the new user is created, you can enter a name, and a password for the user.
2. Now if you want to switch users, type the following command and hit Enter. In the command below, type your username in place of the term ‘username’. For example, if your username is xyz, then type the command su xyz
su username
3. If you want to change your default user, you will have two different situations. One is where you want to set your existing current user account as the default user and another situation where want to create a new user and then set it as the default user.
A. If you want to set an existing user as the default user, then copy and paste the following command. As mentioned earlier, replace the term ‘username’ with your own username.
LxRun.exe /setdefaultuser username
B. This command will create a user account in case the account you want to create is not yet created.
4. Changing password for a user is very easy. All you need to do is open Bash in Windows 10. Next, switch to the user you want to change the password for. Now enter the following command:
passwd
On entering the command, first you will be asked to enter the current password before you change it. Here one important thing to remember: if you have forgotten your current password, you won’t be able to set a new password. And if you have forgotten the password there’s nothing much you can do. So remember the password. Make it simple but not too easy.