The procedure of Linux and Windows password reset.
Linux password reset
- Plug the iso image with the same OS and architecture.
- Set the disk reading to be the first in the boot order and restart the server.
- Go to console (Recovery mode or Rescue).
- Enter the following commands:
mkdir /mnt/tmp – create a temporary directory to mount the section.
mount /dev/sda1 /mnt/tmp – command to mount the first section at the first disk to /mnt/tmp folder
It is necessary to mount the section with /etc /sys /proc and others system folders. If the installation was not successful you may reinstall the section using umount /mnt/tmp command and do the procedure again.
chroot /mnt/tmp – the command to assign the root section to /mnt/tmp folder. So / means /mnt/tmp/.
passwd root – assign a new password for the user.
umount /mnt/tmp – reinstall the section.
Pull out the disk, change the boot order to the standard one (HDD to boot first) and restart your server.
Windows Server 2012 and Windows 8 password reset
- Mount the iso image with the required OS version.
- Select “System restore” at the beginning.
- Go to console.
- Command setup
- Copy (save) Sethc.exe file using temp command to the temporary folder:
copy d:\windows\System32\sethc.exe d:\temp
- Change sethc.exe file to Cmd.exe file using copy command:
copy d:\windows\System32\cmd.exe d:\windows\System32\sethc.exe
- Exit the console.
- Reboot the computer.
Select “Command Prompt”.
Create a temp folder on D drive if it was not created before.
Notification: In this case, the C drive is perceived by the machine as a D drive. The boot disk created section C for itself, so all other sections were moved. At this step you need to check the disks carefully.
Reboot OS and press Shift 5 times (sethc.exe program is responsible for this, we changed it to cmd.exe).If the console did not open press the switch contrast button (this button is placed under the date).
Assign the new password to the new local user Administrator
net user “Administrator” your_password
Close the window and enter system using the new password.
If the account is disabled, you can enable it with the following command.
net user “Administrator” /active:yes
You may change the password of any local user.
Notification: this method will not work for operating systems which are in the domain and are authenticated under Active Directory (AD).
For Windows Server 2003-2008 and Windows XP, 7 the procedure is identical, but you need to change cmd.exe to utilman.exe (options)