# Change Window Server Password (Locked Out)

Sometimes Windows account's will lock up due to too many failed tries, or you forget your Windows Server password.

{% hint style="warning" %}
You will need some basic knowledge of Linux for this
{% endhint %}

* <mark style="color:blue;">**Reboot the vps/server into rescue mode**</mark>

{% hint style="info" %}

* Rescue Mode must be on for the admin password to be changed.
  {% endhint %}

- <mark style="color:blue;">**Mount the system partition**</mark>

- You will need to connect to the server via SSH or use the KVM/ Console

- Find the drive that Windows is installed on (usually the same size as your storage) you can run the command lsblk to see the list of drives

<mark style="color:green;">`ntfsfix /dev/sdb2`</mark>

<mark style="color:green;">`mount -t ntfs-3g /dev/sdb2 /mnt`</mark>

* <mark style="color:blue;">**Clear The Current Pass**</mark>

* SAMfile is edited by using a tool in Linux to edit Windows systems

* Sometimes you need to install chntpw on the system.. <mark style="color:green;">`apt install chntpw`</mark>

* The command below will list all users on the system

<mark style="color:green;">`chntpw -l /mnt/Windows/System32/config/SAM`</mark>

* The next command, you will need to replace USER with the account you'd like to edit

<mark style="color:green;">`chntpw -u USER /mnt/Windows/System32/config/SAM`</mark>

* Type "1" and press Enter. (Make use of option 2 first if there is an "X" next to "Disabled".)
* Type "q" and press Enter to quit the tool. Type "y" when prompted and press Enter.

Reboot Server

{% hint style="warning" %}
DO NOT SKIP THIS STEP
{% endhint %}

* &#x20;Connect to your server and enter cmd into the search bar to open the Command Prompt.
* Set the password for the current user ("Administrator"): <mark style="color:green;">`net user Administrator`</mark>
