Anyone considering doing this should understand that this writes to your NTFS partition with Knoppix. Some people think this is safe. Other people report problems with it, including completely destroying their data.
Heres a small script I wrote that auto detects if Vista or XP is in Use. It then mounts the partition
and runs chntpw in interactive mode. If dual boot i.e. Vista and XP are in use, it detects both OS's
giving the option to reset or quit.
You can copy the lines inssert the file onto a usb drive. Next time you use knoppix 5.11 or 5.31
install chntpw first:
apt-get update
apt-get install chntpw
Use the script at your own risk, theres always an element of piracy hence the warning message.
#!/bin/sh
#password reset for XP/Vista run as sudo or kdesu
#
#
clear
echo -e "\E[32m Reset Password Utility for XP and Vista"
echo
echo
echo
for i in hda1 hda2 hda3 hda4 hdb1 hdb2 hdb3 hdb4 sda1 sda2 sda3 sda4 sdb1 sdb2 sdb3 sdb4
do
mkdir /media/$i 2>/dev/null
mount /dev/$i /media/$i 2>/dev/null
# Detect WinXP
if [ -e /media/$i/boot.ini ]; then
echo -e "\E[37m Windows XP detected on /dev/$i"
echo
echo -e "\E[33m Warning:";echo -e "\E[31m Please ensure you have a reasonable guarantee from the customer that
this computer is owned by them before proceeding."
echo -e "\E[32m "
echo
sleep 6
chntpw -i /media/$i/WINDOWS/system32/config/SAM
umount /media/$i
fi
# Detect Vista
clear
if [ -e /media/$i/Users ]; then
echo -e "\E[36m Windows Vista detected on /dev/$i"
echo
echo -e "\E[33m Warning:";echo -e "\E[31m Please ensure you have a reasonable guarantee from the customer that
this computer is owned by them before proceeding."
echo -e "\E[36m "
echo
echo
sleep 6
chntpw -i /media/$i/Windows/System32/config/SAM
umount /media/$i
fi
if [ $i == sdb4 ] && [ -e /media/$i/Users -o -e /media/$i/boot.ini ]; then
echo -e "\E[36m No Operating System detected"
sleep 4
fi
done
Anyone considering doing this should understand that this writes to your NTFS partition with Knoppix. Some people think this is safe. Other people report problems with it, including completely destroying their data.
---
Verifying of md5 checksum and burning a CD at slow speed are important.
Yes, good point. With knoppix 5.1.1 which uses kernel 2.4.19 a warning does appear about upgrading to a kernel 2.6.20 or higher when using ntfsprogs. Personally I've never lost data on an NTFS partition using linux, even with the earlier Captive program on a 2.4.xx kernel, but have lost plenty of data with windows. Knoppix 5.3.1 uses kernel 2.4.24 but there is always a small element of risk.Originally Posted by Harry Kuhman
Even the chntpw program suggests not changing a password but just blanking it. The above script should therefore be used at your own risk, as stated previously.
I'm among those lucky one which never lost any data when writing to ntfs.
I double check on my knoppix 5.1.1, it runs kernel 2.6.19.
Just curious, on your shell script, the /dev/$i is mounted as read-only. So does that mean that the program chntpw still be able to write to the mount point /media/$i?
Rgds,
Chip
Hi Chip,Originally Posted by chip.ling
Sorry wrote this using knoppix 5.3.1 which uses ntfs-3g as default and therefore mouting ntfs partitions are rw.
Forr knoppix 5.1.1 install ntfs-3g
and change the following line
mount /dev/$i /media/$i 2>/dev/null
to read
mount -rw /dev$i /media$i 2>dev/null
this should mount all partitions with rw access.
Dell PowerEdge R730 2x E5-2699V3 2.3Ghz 36 Core 128GB RAM H730 X520-I350 2x750W
$329.99
Dell Poweredge R730xd LFF 14-Bay 2U Server | Choose Your CPU & RAM Config
$477.99
Dell Poweredge R630 Server 2x E5-2620 V4 =16 Cores | S130 | 32GB RAM | 2x trays
$159.99
DELL PowerEdge R630 8SFF Server 2x E5-2690v4 2.6GHz =28 Cores 256GB H730 4xRJ45
$562.00
Dell PowerEdge R630 Server 2x E5-2680 V4 = 28 Cores S130 32GB RAM NEW 480GB SSD
$197.99
Dell PowerEdge R630 Server 2x E5-2640v3 2.60Ghz 16-Core 64GB H330
$182.65
DELL R630 SERVER 8 x 2.5'' 2X E5-2680V4 32GB RAM IDRAC ENT & NDC 2X 495W PSU
$184.95
SuperMicro Server 505-2 Intel Atom 2.4GHz 8GB RAM SYS-5018A-FTN4 1U Rackmount
$202.49
1U Supermicro Server 10 Bay 2x Intel Xeon 3.3Ghz 8C 128GB RAM 240GB SSD 2x 10GBE
$259.00
DELL PowerEdge R630 8SFF Server 2x E5-2643v3 3.4GHz =12 Cores 64GB H730 4xRJ45
$270.00