I have installed both Ubuntu and Kali Linux installed at the same time But when I run bash by default it opens up Ubuntu.

In new Windows versions, users can install and run multiple GNU/Linux distributions. One can configure the default distribution (i.e. the distribution that comes up with wsl.exe) with wslconfig /s <disrto_name> command. e.g. To open Kali with wsl.exe at first run, use this command wslconfig /s kali-linux or run kali.exe.

I have forgotten the root password in Kali, there is just the terminal of Kali Linux and nothing else. How can I reset my password safely?

First of all, I don't know if this procedure is safe or not. At the time of writing, WSL manages the default login user from DefaultUID registry (this may change in future). Close any opened WSL instance. To edit this registry value, open Registry Editor or regedit.exe from start menu or run dialog box. Go to this registry path or type this path with Ctrl + L in that Window:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss 

You may see one or multiple subkeys (like subfolders) with names something like {12345678-1234-1234-1234-123456789012} (called GUID). Double click on them to open one-by-one and match the DistributionName value with your desired distribution name, here it will be kali-linux (see below). Double click on the DefaultUID value and change it to ZERO. Zero is for root user and 1000 or 0x3e8 (in hexadecimal) for normal users.

Open wsl.exe in command prompt. The prompt changes from $ to # (means root user). Run passwd command in Kali, change root password as usual. Now go back to previous registry key, change Zero to previous value (or 3e8 in hex). Here is an example of the registry values:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss]
"DefaultDistribution"="{f029d4cd-b7ee-42bc-ae02-af8f2c97f495}"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{f029d4cd-b7ee-42bc-ae02-af8f2c97f495}]
"State"=dword:00000001
"DistributionName"="kali-linux"
"Version"=dword:00000001
"BasePath"="C:\\MyFiles\\kali-linux"
"KernelCommandLine"="BOOT_IMAGE=/kernel init=/init ro"
"DefaultUid"=dword:000003e8
"Flags"=dword:00000007

Further details:

  • Managing multiple Linux Distributions
  • passwd manual page
  • How to reset Kali linux root password
Answer from Biswapriyo on Stack Exchange
🌐
Top Password
top-password.com › knowledge › reset-windows-10-password-with-kali-linux.html
How to Reset Windows 10 Local Password with Kali Linux Live USB
Simply run the chntpw -u username SAM command to reset your lost password. Note: where username is the name of your actual Windows account. For example, my username is test, I should type chntpw -u test SAM after that hit Enter. Press 1 for clearing the previously set Windows password.
🌐
MHarwood Web Solutions
mharwood.uk › home › linux › resetting windows password with kali linux
Resetting Windows Password With Kali Linux - MHarwood Web Solutions
October 11, 2024 - You can also reset Windows passwords using the Windows installer, or by using Ubuntu. However, both of those methods have their own downsides which make Kali my favourite. ... Personally, I like my website. A lot. And I wouldn’t want one mistake to make… ... More of a story and vent than an informative article. So to save you reading… ... First, mount the Kali Linux live boot ISO to the VM.
🌐
Cybrary
cybrary.it › blog › reset-windows-7-via-kali
Reset Windows Passwords with Kali Linux | Cybrary
Reset forgotten Windows password using Kali Linux. Step-by-step with requirements, steps & commands. Access computer easily!
🌐
Medium
medium.com › @tkutto › unlocking-windows-a-guide-to-resetting-forgotten-passwords-with-kali-linux-f2555cc43f85
Unlocking Windows: A Guide to Resetting Forgotten Passwords with Kali Linux | by Trevor Kutto Hacks | Medium
September 12, 2024 - This step-by-step guide equips you to unlock Windows devices without the user password and avoids the drastic measure of hard disk formatting. ... Download Kali Linux ISO Image: Begin by acquiring the Kali Linux ISO image from the official website. Utilize Rufus for Bootable USB: Employ Rufus, a USB imaging tool. Download and install it, then locate your Kali Linux image.
Top answer
1 of 4
5

I have installed both Ubuntu and Kali Linux installed at the same time But when I run bash by default it opens up Ubuntu.

In new Windows versions, users can install and run multiple GNU/Linux distributions. One can configure the default distribution (i.e. the distribution that comes up with wsl.exe) with wslconfig /s <disrto_name> command. e.g. To open Kali with wsl.exe at first run, use this command wslconfig /s kali-linux or run kali.exe.

I have forgotten the root password in Kali, there is just the terminal of Kali Linux and nothing else. How can I reset my password safely?

First of all, I don't know if this procedure is safe or not. At the time of writing, WSL manages the default login user from DefaultUID registry (this may change in future). Close any opened WSL instance. To edit this registry value, open Registry Editor or regedit.exe from start menu or run dialog box. Go to this registry path or type this path with Ctrl + L in that Window:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss 

You may see one or multiple subkeys (like subfolders) with names something like {12345678-1234-1234-1234-123456789012} (called GUID). Double click on them to open one-by-one and match the DistributionName value with your desired distribution name, here it will be kali-linux (see below). Double click on the DefaultUID value and change it to ZERO. Zero is for root user and 1000 or 0x3e8 (in hexadecimal) for normal users.

Open wsl.exe in command prompt. The prompt changes from $ to # (means root user). Run passwd command in Kali, change root password as usual. Now go back to previous registry key, change Zero to previous value (or 3e8 in hex). Here is an example of the registry values:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss]
"DefaultDistribution"="{f029d4cd-b7ee-42bc-ae02-af8f2c97f495}"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{f029d4cd-b7ee-42bc-ae02-af8f2c97f495}]
"State"=dword:00000001
"DistributionName"="kali-linux"
"Version"=dword:00000001
"BasePath"="C:\\MyFiles\\kali-linux"
"KernelCommandLine"="BOOT_IMAGE=/kernel init=/init ro"
"DefaultUid"=dword:000003e8
"Flags"=dword:00000007

Further details:

  • Managing multiple Linux Distributions
  • passwd manual page
  • How to reset Kali linux root password
2 of 4
14

I appreciate this is an older question but I wanted to provide the answer based on Microsoft guidance as I stumbled across this and knew there had to be a better way.

This is based on the article available at https://docs.microsoft.com/en-us/windows/wsl/user-support running the device running at least Windows 10 1709 (Fall Creators Update)

  1. Ensure Kali is not running
  2. Open a command prompt (cmd.exe)
  3. From the command prompt, run kali config --default-user root
  4. Run Kali, you should login as root automatically
  5. In Kali, run passwd user where user is the username of the account you wish the reset the password for, i.e. passwd bob
  6. Follow the prompts to reset the password and then type exit to close Kali
  7. From the command prompt, run kali config --default-user user where user is the username you have just reset the password for, i.e. kali config --default-user bob

Following these steps, you should be able to reset the password for your account in Kali on WSL.

🌐
HdfsTutorial
hdfstutorial.com › home › blog › how to reset windows 10 password using kali linux
How To Reset Windows 10 Password Using Kali Linux - HdfsTutorial
December 20, 2019 - Just download the utility on the other PC and click a couple of buttons to create your reset disk. This can then be used to boot your locked Windows 10 machine. The interface lets you select the right ISO file and unlock any local or network ...
🌐
YouTube
youtube.com › watch
Bypassing Windows Password Using Kali Linux | Reset Windows Passwords with Kali Linux | Kali Linux - YouTube
This video shows how to reset a Windows password through Kali Linux.Please follow these steps:# lsblk# cd /media/4../Windows/System32/config# chntpw -l SAM# ...
Published   March 6, 2024
🌐
Miloserdov
miloserdov.org
How to reset a Windows password - Ethical hacking and penetration testing
In addition, if the files on the disks are encrypted with a Windows password, then it is impossible to access (extract or copy) them even if you boot from the LIVE system – in this case there is only one way out – to reset the Windows password. ... Each step is described as detailed as possible – you will definitely succeed. We need a USB flash drive with 3 or more Gigabytes, or an external (USB) drive. The instruction may seem quite voluminous, but it is a 100% working way to log into Windows if you forget the password. Go to the official Kali Linux page: https://www.kali.org/downloads/
Find elsewhere
🌐
Reddit
reddit.com › r/kalilinux › reset windows password
r/Kalilinux on Reddit: reset windows password
May 27, 2021 -

I have Kali Linux on a USB drive, Trying to reset my password or remove my password. I got root installed an I'm on root. so all my files don't have the lock on it anymore. I can't access windows to system32 I can only assume since there different OS that's why I am not able to. I thought I tried to mount the sda1 drive but I guess not? if anyone has any idea how I can access it so I can change my SAM file. that would be great.

🌐
YouTube
youtube.com › watch
How to Remove Windows 10 Login Password Using Kali Linux - YouTube
how to crack windows 10 pasword using chntpwcrack windows 10 password using kali linux clear windows 10 password using kali liveclear windows 10 password usi...
Published   July 4, 2022
🌐
YouTube
youtube.com › watch
How to Reset Forgotten Windows Login Password using Kali Linux - YouTube
In this guide, you’re going to learn how to reset a forgotten local user login password on any Windows computer using Kali Linux.Download the ISO image of Ka...
Published   November 13, 2023
🌐
ExamCollection
examcollection.com › blog › step-by-step-guide-to-reset-windows-passwords-via-kali-linux
Step-by-Step Guide to Reset Windows Passwords via Kali Linux – ExamCollection
Chntpw can load and edit the SAM database, allowing users to reset or blank Windows account passwords without damaging the user profile. It supports multiple versions of Windows, from Windows XP up to Windows 10 and beyond. Besides chntpw, Kali Linux also includes other utilities and scripts ...
🌐
YouTube
youtube.com › watch
How to reset administrator Password with Kali Linux ? - YouTube
Ethical Hacking and Penetration Testing 100% Practical Course. No boring theory. Hack Severs, Networks, Mobile Devices, Wi-Fi Like Black Hackers.
Published   December 26, 2022
🌐
Opensource.com
opensource.com › article › 18 › 3 › how-reset-windows-password-linux
How to reset a Windows password with Linux | Opensource.com
Here are the steps, along with screenshots, to guide you through the quick and super easy process of resetting your Windows password with chntpw. 1. Attach the Live USB to your PC and restart from the login screen, as shown below: ... 3. Log out from live-user and log into root. This step is not necessary, but I prefer to use the root user to bypass any permission issues: ... 4. Install the chntpw utility with the following command (you'll need a live internet connection for this): ... 7. Type 1 to clear the user password or 2 to set a new password for the Archit-PC user, then quit and save the changes:
🌐
Kali Linux
kali.org › tools › chntpw
chntpw | Kali Linux Tools
December 9, 2025 - NT SAM password recovery utility This little program provides a way to view information and change user passwords in a Windows NT/2000 user database file. Old passwords need not be known since they are overwritten. In addition it also contains a simple registry editor (same size data writes) and an hex-editor which enables you to fiddle around with bits and bytes in the file as you wish. If you want GNU/Linux bootdisks for offline password recovery you can add this utility to custom image disks or use those provided at the tools homepage.
🌐
Wikigain
wikigain.com › home › how to reset forgotten windows 10 password and kali linux?
Reset Forgotten Windows 10 Password and Kali Linux? - Wikigain
July 16, 2019 - Just select the second option “Advanced Options for Kali GNU/Linux”. Don’t hit enter, press E button from your keyboard. ... Step #2. From the last paragraph, find ro and change it into rw. After adding this command right after initrd\.gz init=/bin/bash then press F10 key from your keyboard. ... Step #3. Your computer loads lots of commands or text, wait for a while, then type the following command. ... Type new password. And confirm it ... It was all about how to Reset Forgotten Windows 10 Password?
🌐
YouTube
youtube.com › progragamer
Reset your Windows Login Password by Kali Linux Bootable USB Drive - YouTube
This video for educational purposes only ! Use this only on your own pc or authorized one to use !Using ISO image of kali Linux in a bootable USB drive can ...
Published   January 22, 2022
Views   6K
🌐
YouTube
youtube.com › watch
Reset Forgotten Windows Password With Kali Linux - YouTube
Reset Forgotten Windows Password With Kali LinuxIt's pretty common for people to forget their Windows user login password, it's very easy to reset if you kno...
Published   May 13, 2017
🌐
DevOps.dev
blog.devops.dev › resetting-windows-passwords-with-kali-linux-1234742a1922
Resetting Windows Password With Kali Linux | by Mark Harwood | DevOps.dev
October 11, 2024 - You can also reset Windows passwords using the Windows installer, or by using Ubuntu. However, both of those methods have their own downsides which make Kali my favourite. ... First, mount the Kali Linux live boot ISO to the VM.
🌐
Linux Hint
linuxhint.com › reset_password_kali_linux
How to Reset Password in Kali Linux – Linux Hint
If you enter the wrong password, it is going to say that the password is incorrect and to try again. At this point, you should simply restart Kali Linux. The next sections provide instructions you can follow to reset your password in Kali Linux.