How to Change User Password in Windows Subsystem for Linux (WSL) Distro in Windows 10
The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop and modern store apps.
When you have Windows Subsystem for Linux (WSL) enabled, you can install WSL distro apps from the Microsoft Store, and export and import WSL distros.
The first time a newly installed WSL distro runs, a Console window will open, and you'll be asked to wait for a minute or two for the installation to complete.
Once installation is complete, you will be prompted to create a new user account (and its password).
Creating your Linux user is the first step in setting up a new Linux distribution on WSL. The first user account you create is automatically configured with a few special attributes:
- It is your default user -- it signs-in automatically on launch.
- It is Linux administrator (a member of the sudo group) by default.
Each Linux distribution running on the Windows Subsystem for Linux has its own Linux user accounts and passwords. You will have to configure a Linux user account any time you add a distribution, reinstall, or reset. Linux user accounts are not only independent per distribution, they are also independent from your Windows 10 user account.
When you open a new distro instance, you won't be prompted for your password, but if you elevate a process usingsudo
, you will need to enter your password, so make sure you choose a password you can easily remember.
If you have access to your Linux user account and know your current password, you can change it using Linux password reset tools of that distribution -- most likelypasswd
.
If that's not an option, depending on the distribution, you may be able to reset your password by resetting the default user.
See also:
- Install Windows Subsystem for Linux (WSL) on on Windows 10 | Microsoft Docs
- Initialize a new WSL Linux distro | Microsoft Docs
- Linux User Account and Permissions | Microsoft Docs
This tutorial will show you how to change the password of a user in a Windows Subsystem for Linux (WSL) distro in Windows 10.
Here's How:
1. Open a command prompt or PowerShell.
2. Enter the command below into the command prompt or PowerShell for this WSL distro name (ex: "Ubuntu") and user name (ex: "brink") you want to change the password for, and press Enter. (see screenshot below)
This command will change the default user of the WSL distro (ex: "Ubuntu") to the user (ex: "brink") you want to change the password for.
(Ubuntu)
![]()
ubuntu config --default-user <username>
OR
(openSUSE Leap 42)
![]()
openSUSE-42 config --default-user <username>
OR
(SUSE Linux)
![]()
SLES-12 config --default-user <username>
OR
(Debian)
![]()
debian config --default-user <username>
OR
(Kali Linux)
![]()
kali config --default-user <username>
Substitute <username> with the actual UNIX username (ex: "brink") you want to change the password for in this WSL distro.
For example:ubuntu config --default-user brink
3. Copy and paste the command below into the command prompt or PowerShell to run the .exe file of the same WSL distro (ex: "Ubuntu") above, and press Enter.
(Ubuntu)
![]()
ubuntu
OR
(openSUSE Leap 42)
![]()
openSUSE-42
OR
(SUSE Linux)
![]()
SLES-12
OR
(Debian)
![]()
debian
OR
(Kali Linux)
![]()
kali
4. Typepasswd
into the command prompt or PowerShell, and press Enter to change the password of this user (ex: "brink") in this WSL distro (ex: "Ubuntu").
5. When prompted:
- Enter (current) UNIX password for this username.
- Enter new UNIX password for this username.
- Retype new UNIX password to confirm.
6. When finished, you can close the command prompt or PowerShell if you like.
That's it,
Shawn
Related Tutorials
- How to Enable or Disable Windows Subsystem for Linux (Bash on Ubuntu) in Windows 10
- How to Install Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to Update and Upgrade Windows Subsystem for Linux (WSL) Distro Packages in Windows 10
- How to Add User to Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Remove User from Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Add, Remove, and List Sudo Users in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to List Users in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Set Default User for Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Switch User in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Reset User Password in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Unregister and Reset Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Run a Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Set Default Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Export and Import Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Add or Remove Linux in Navigation Pane of File Explorer in Windows 10
- How to List All Available Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to List All Running Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to Terminate Running Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Access Linux Files in a Windows Subsystem for Linux (WSL) Distro from Windows 10