|
1 | 1 | ---
|
2 |
| -title: Resetting a Windows password |
3 |
| -excerpt: Find out how to reset your Windows account password |
4 |
| -updated: 2020-11-25 |
| 2 | +title: Changing the admin password on a Windows server |
| 3 | +excerpt: Find out how to reset your Windows Administrator account password on a VPS or a Public Cloud instance using the OVHcloud rescue mode |
| 4 | +updated: 2023-10-29 |
5 | 5 | ---
|
6 | 6 |
|
7 | 7 | ## Objective
|
8 | 8 |
|
9 |
| -In some cases you might need to reset a Windows password. This guide will show you how to reset the password of your Windows user account and successfully log in to your VPS again. |
| 9 | +When you install or reinstall a Windows Server operating system, you are provided with a password for administrative access (*Administrator* account). |
| 10 | + |
| 11 | +If you have lost your Administrator password, you can reset it via the OVHcloud rescue mode. |
| 12 | + |
| 13 | +**This guide explains how to reset the password of the admin account of a Windows Server OS in the OVHcloud rescue mode.** |
10 | 14 |
|
11 | 15 | ## Requirements
|
12 | 16 |
|
13 |
| -- The VPS must be in rescue mode (see [Activating rescue mode on a VPS](/pages/bare_metal_cloud/virtual_private_servers/rescue)). |
| 17 | +- A [VPS](https://www.ovhcloud.com/asia/vps/) or a [Public Cloud instance](https://www.ovhcloud.com/asia/public-cloud/) in your OVHcloud account |
| 18 | +- Access to the [OVHcloud Control Panel](https://ca.ovh.com/auth/?action=gotomanager&from=https://www.ovh.com/asia/&ovhSubsidiary=asia) |
14 | 19 |
|
15 | 20 | ## Instructions
|
16 | 21 |
|
17 |
| -Connect to the VPS via VNC in the [OVHcloud Control Panel](https://ca.ovh.com/auth/?action=gotomanager&from=https://www.ovh.com/asia/&ovhSubsidiary=asia) with the login details you have received by email. |
| 22 | +### Step 1: Reboot the server into rescue mode |
| 23 | + |
| 24 | +Rescue mode has to be activated before the admin password can be changed. |
| 25 | + |
| 26 | +Use the respective guide to restart your OVHcloud service into rescue mode: |
| 27 | + |
| 28 | +- [VPS](/pages/bare_metal_cloud/virtual_private_servers/rescue) |
| 29 | +- [Public Cloud instance](/pages/public_cloud/compute/put_an_instance_in_rescue_mode) |
| 30 | + |
| 31 | +### Step 2: Mount the system partition |
| 32 | + |
| 33 | +Connect to your server via SSH. (Consult the [SSH introduction guide](/pages/bare_metal_cloud/dedicated_servers/ssh_introduction) if necessary.) |
18 | 34 |
|
19 |
| -Type the following commands to mount the remote file system: |
| 35 | +Alternatively, you can open a server connection by using [KVM (VPS)](/pages/bare_metal_cloud/virtual_private_servers/using_kvm_for_vps) or the [VNC console (Public Cloud instance)](/pages/public_cloud/compute/first_steps_with_public_cloud_instance#accessvnc). |
20 | 36 |
|
21 |
| -```sh |
| 37 | +Type the following commands to mount the Windows file system: |
| 38 | + |
| 39 | +```bash |
22 | 40 | ntfsfix /dev/sdb2
|
| 41 | +``` |
| 42 | + |
| 43 | +```bash |
23 | 44 | mount -t ntfs-3g /dev/sdb2 /mnt
|
24 | 45 | ```
|
25 | 46 |
|
26 |
| -Now start the password reset procedure: |
| 47 | +### Step 3: Clear the current password |
27 | 48 |
|
28 |
| -```sh |
29 |
| -cd /mnt/Windows/System32/config |
30 |
| -chntpw -l SAM |
| 49 | +In this step the *SAM* file is edited by using a rescue mode tool. List the Windows users with this command: |
| 50 | + |
| 51 | +```bash |
| 52 | +chntpw -l /mnt/Windows/System32/config/SAM |
31 | 53 | ```
|
32 | 54 |
|
33 |
| -You will see a list of users. Take note of the administrator account (or the account you wish to change the password for). In this example, we will use `Administrator`. Please note that the commands are case-sensitive. |
| 55 | +```text |
| 56 | +| RID -|---------- Username ------------| Admin? |- Lock? --| |
| 57 | +| 01f4 | Administrator | ADMIN | dis/lock | |
| 58 | +| 01f7 | DefaultAccount | | dis/lock | |
| 59 | +| 01f5 | Guest | | dis/lock | |
| 60 | +| 01f8 | WDAGUtilityAccount | | dis/lock | |
| 61 | +``` |
34 | 62 |
|
35 |
| -```sh |
36 |
| -chntpw -u Administrator SAM |
| 63 | +In this example output, `Administrator` is the local admin account. Start the reset procedure with the following command. (Use `admin` in case `Administrator` does not exist.) |
| 64 | + |
| 65 | +```bash |
| 66 | +chntpw -u Administrator /mnt/Windows/System32/config/SAM |
37 | 67 | ```
|
38 | 68 |
|
39 |
| -Press `1` and `Enter` to clear the password. Press `q` to quit the password change prompt. Afterwards, press `y` to write the changes to the file. |
| 69 | +```text |
| 70 | +RID : 0500 [01f4] |
| 71 | +Username: Administrator |
| 72 | +fullname: |
| 73 | +comment : Built-in account for administering the computer/domain |
| 74 | +homedir : |
| 75 | +
|
| 76 | +00000220 = Administrators (which has 1 members) |
| 77 | +
|
| 78 | +Account bits: 0x0010 = |
| 79 | +[ ] Disabled | [ ] Homedir req. | [ ] Passwd not req. | |
| 80 | +[ ] Temp. duplicate | [X] Normal account | [ ] NMS account | |
| 81 | +[ ] Domain trust ac | [ ] Wks trust act. | [ ] Srv trust act | |
| 82 | +[ ] Pwd don't expir | [ ] Auto lockout | [ ] (unknown 0x08) | |
| 83 | +[ ] (unknown 0x10) | [ ] (unknown 0x20) | [ ] (unknown 0x40) | |
| 84 | +
|
| 85 | +Failed login count: 47034, while max tries is: 0 |
| 86 | +Total login count: 5 |
| 87 | +
|
| 88 | +- - - - User Edit Menu: |
| 89 | + 1 - Clear (blank) user password |
| 90 | + 2 - Unlock and enable user account [probably locked now] |
| 91 | + 3 - Promote user (make user an administrator) |
| 92 | + 4 - Add user to a group |
| 93 | + 5 - Remove user from a group |
| 94 | + q - Quit editing user, back to user select |
| 95 | +Select: [q] > |
| 96 | +``` |
40 | 97 |
|
41 |
| -You can now leave the rescue mode and reboot normally (see [Activating rescue mode on a VPS](/pages/bare_metal_cloud/virtual_private_servers/rescue)). |
| 98 | +Type "1" and press `Enter`. (Make use of option 2 first if there is an "X" next to "Disabled".) |
42 | 99 |
|
43 |
| -When logging in to your VPS now, you will not have to enter a password to log in to a Windows session. |
| 100 | +```text |
| 101 | +Select: [q] > 1 |
| 102 | +Password cleared! |
| 103 | +``` |
| 104 | + |
| 105 | +Type "q" and press `Enter` to quit the tool. Type "y" when prompted and press `Enter`. |
| 106 | + |
| 107 | +```text |
| 108 | +Select: [q] > q |
| 109 | + |
| 110 | +Hives that have changed: |
| 111 | + # Name |
| 112 | + 0 </mnt/Windows/System32/config/SAM> |
| 113 | +Write hive files? (y/n) [n] : y |
| 114 | + 0 </mnt/Windows/System32/config/SAM> - OK |
| 115 | +``` |
| 116 | + |
| 117 | +### Step 4: Reboot the server |
| 118 | + |
| 119 | +You can now leave rescue mode and restart the server. If necessary, use the respective guide for your service: |
| 120 | + |
| 121 | +- [VPS](/pages/bare_metal_cloud/virtual_private_servers/rescue) |
| 122 | +- [Public Cloud instance](/pages/public_cloud/compute/put_an_instance_in_rescue_mode) |
| 123 | + |
| 124 | + |
| 125 | +### Step 5: Set a new password (KVM / VNC) |
44 | 126 |
|
45 | 127 | > [!warning]
|
46 | 128 | >
|
47 |
| -> It is extremely unsafe to leave the Administrator account (or any account with administrative privileges) password blank. Please log in immediately to your VPS and change the password. |
| 129 | +> Do not skip this step. An unprotected Administrator account is a severe security risk. |
48 | 130 | >
|
49 | 131 |
|
50 |
| -Once logged in to your Windows session, press `CTRL` + `ALT` + `DELETE` and then click on `Change a password`. If you are using the VNC console, click on the button on the top right that says `Send CtrlAltDel`. |
| 132 | +Connect to your server and enter `cmd` into the search bar to open the `Command Prompt`. |
| 133 | + |
| 134 | +Set the password for the current user ("Administrator"): |
| 135 | + |
| 136 | +```powershell |
| 137 | +net user Administrator * |
| 138 | +``` |
| 139 | + |
| 140 | +{.thumbnail} |
51 | 141 |
|
52 |
| -Leave the `Old password` field blank and type your new password twice. Make sure the passwords provided match. |
| 142 | +You can now log in as "Administrator" with this new password. |
53 | 143 |
|
54 | 144 | ## Go further
|
55 | 145 |
|
56 |
| -Join our community of users on <https://community.ovh.com/en/>. |
| 146 | + |
| 147 | +Join our community of users on <https://community.ovh.com/en/>. |
0 commit comments