images: add windows-rescue
This commit is contained in:
parent
f73f38f5ba
commit
a5ee81b61f
2 changed files with 62 additions and 0 deletions
13
images/windows-rescue/README.md
Normal file
13
images/windows-rescue/README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# To Fix Windows Issues
|
||||
|
||||
## reset password
|
||||
|
||||
* use `sfdisk -l` to list partitions
|
||||
* find the partition which holds `Windows/System32/config`
|
||||
* mount it `mkdir -p /media/sda2; mount /dev/sda2 /media/sda2`
|
||||
* `cd /media/sda2/Windows/System32/config`
|
||||
* list SAM database `chntpw -l SAM`
|
||||
* edit SAM database `chntpw -i SAM`
|
||||
* reboot
|
||||
|
||||
more details [here](https://opensource.com/article/18/3/how-reset-windows-password-linux).
|
49
images/windows-rescue/config.nix
Normal file
49
images/windows-rescue/config.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
# NixOS livesystem to reset windows passwords
|
||||
# Step by step guide : https://opensource.com/article/18/3/how-reset-windows-password-linux
|
||||
# $ nixos-generator -f iso -c config.nix
|
||||
{ pkgs, ... }: let
|
||||
wifi = {
|
||||
ssid = "";
|
||||
plainTextPassword = "";
|
||||
};
|
||||
remote-access = import ../lib/remote-access.nix {
|
||||
publicSshKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6uza62+Go9sBFs3XZE2OkugBv9PJ7Yv8ebCskE5WYPcahMZIKkQw+zkGI8EGzOPJhQEv2xk+XBf2VOzj0Fto4nh8X5+Llb1nM+YxQPk1SVlwbNAlhh24L1w2vKtBtMy277MF4EP+caGceYP6gki5+DzlPUSdFSAEFFWgN1WPkiyUii15Xi3QuCMR8F18dbwVUYbT11vwNhdiAXWphrQG+yPguALBGR+21JM6fffOln3BhoDUp2poVc5Qe2EBuUbRUV3/fOU4HwWVKZ7KCFvLZBSVFutXCj5HuNWJ5T3RuuxJSmY5lYuFZx9gD+n+DAEJt30iXWcaJlmUqQB5awcB1S2d9pJ141V4vjiCMKUJHIdspFrI23rFNYD9k2ZXDA8VOnQE33BzmgF9xOVh6qr4G0oEpsNqJoKybVTUeSyl4+ifzdQANouvySgLJV/pcqaxX1srSDIUlcM2vDMWAs3ryCa0aAlmAVZIHgRhh6wa+IXW8gIYt+5biPWUuihJ4zGBEwkyVXXf2xsecMWCAGPWPDL0/fBfY9krNfC5M2sqxey2ShFIq+R/wMdaI7yVjUCF2QIUNiIdFbJL6bDrDyHnEXJJN+rAo23jUoTZZRv7Jq3DB/A5H7a73VCcblZyUmwMSlpg3wos7pdw5Ctta3zQPoxoAKGS1uZ+yTeZbPMmdbw==";
|
||||
hiddenReceiver = "";
|
||||
};
|
||||
in {
|
||||
|
||||
imports = [ remote-access ];
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.chntpw
|
||||
pkgs.ntfs3g
|
||||
];
|
||||
|
||||
networking.dhcpcd.enable = true;
|
||||
networking.wireless = {
|
||||
enable = true;
|
||||
networks."${wifi.ssid}".psk = wifi.plainTextPassword;
|
||||
};
|
||||
|
||||
environment.extraInit = ''
|
||||
# use vi shortcuts
|
||||
# ----------------
|
||||
set -o vi
|
||||
EDITOR=vim
|
||||
'';
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.auto.enable = true;
|
||||
|
||||
desktopManager = {
|
||||
default = "xfce";
|
||||
xterm.enable = false;
|
||||
xfce.enable = true;
|
||||
xfce.extraSessionCommands = ''
|
||||
${pkgs.midori}/bin/midori https://opensource.com/article/18/3/how-reset-windows-password-linux &
|
||||
${pkgs.xfce.terminal}/bin/xfce4-terminal &
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue