As part of my redundancy package, I was allowed to buy a second hand laptop (with a pretty good spec for the price). It came with Windows 10. I was very close to blowing W10 away (as I've done with all my previous computers), but I then decided to keep it, and perhaps have an install I can use for other purposes. May be even to test Windows Subsystem for Linux. There was one problem: I couldn't log on - no password.
I have never used Windows 10, though I am aware of the security features, which we talk about when discussing booting a modern computer. Somehow, the old methods of using Linux to clear the password didn't feel plausible on a system that has security in mind.
But, with nothing to lose, I picked up a random live distribution - happened to be Mint 19. Boot from it (having to fiddle with the BIOS, to allow that in the first place).
First, to check if the Windows disk is available and recognisable, run
sudo sfdisk -l
This helped me to identify the system Windows partition as /dev/sda3, which I then mounted:
sudo mount /dev/sda3 /mnt
Confirm the contents with:
ls /mnt
All directories (or should I say: folders) I'd expect were there: Windows, Program Files, etc.
Now, prepare Mint, by downloading chntpw (a program capable of peeking into SAM - Windows database where password hashes are stored).
Connected to the Internet, and run:
sudo apt install -y chntpw
Amazingly:
sudo chntpw
worked, listing all users and their password status. After selecting the user (administrator in my case), I was able to enable its account and clear the password.
Removed the Mint pen drive, restarted the computer, and I was in - as administrator - without even as much as being asked for the password