With an administrator account, you can change system settings on your computer and make changes to the file system. Regardless of the operating system, you can change the password for the administrator account at the command line. On Windows computers, the Administrator account is disabled by default, so if you want to use it, you will have to enable it first.
Steps
Method 1 of 3: Windows

Step 1. Understand that there are different types of administrator accounts
On all versions of Windows after XP, the administrator account is disabled by default. This was done for security reasons, as the first personal account you create will be the administrator account by default. Next, you will walk through the process of activating a disabled administrator account and setting a password for it.
If you would like to change the password for your personal administrator account, open the Control Panel and select the "User Accounts" option. Select an administrator account and then click Create Password or Change Password

Step 2. Press the key
⊞ Win and enter "cmd".
In the list of search results, you will see the "Command Prompt" option.

Step 3. Right click on Command Prompt and select "Run as Administrator"

Step 4. Enter
net user administrator / active: yes and press the key ↵ Enter. This will enable the administrator account on the computer. Typically, the Administrator account is enabled to perform automated tasks without the need to see a User Account Control (UAC) message every time it is triggered by a change in system settings.

Step 5. Enter
net user administrator * and press ↵ Enter. This will allow you to change the administrator password.

Step 6. Enter the desired password
Characters will not be displayed when entering a password. Press the ↵ Enter key when entering the password.

Step 7. Re-enter the password to confirm it
If the password does not match, try again.

Step 8. Enter
net user administrator / active: no and press the key ↵ Enter. This will disable the administrator account. It is not recommended to leave the Administrator account enabled when you are not using it. Once you set a password and do whatever you want, disable the account at the command line.
Method 2 of 3: OS X

Step 1. Understand the process
If you have forgotten the password for the administrator account and want to reset it, you can use the Single-user mode to do this. You do not need administrator access to complete this procedure.

Step 2. Restart your computer and hold down the key combination
⌘ Command + S. If you hold down these keys while booting the system, the command line will start.

Step 3. Enter
fsck -fy and press the key ⏎ Return. This will scan your hard drive for errors and take a few minutes. This step is required.

Step 4. Enter
mount -uw / and press the key ⏎ Return. This will allow you to make changes to the filesystem.

Step 5. Enter
passwd Administrator and press the key ⏎ Return. You can change the password for any user account by entering the account name instead of “Administrator”.

Step 6. Enter the new password twice
You will be asked to enter your new password and then asked to enter it again for confirmation. You will not see any symbols while entering your password.

Step 7. Enter
reboot and press the key ⏎ Return. This will restart your computer and load the default operating system. Now the administrator account will work with a different password.
Method 3 of 3: Linux

Step 1. Before you start, you should weigh the risks
Linux is designed in such a way that you can perform administrator tasks without having to log in as an administrator or user with root privileges. Therefore, to perform various operations that require root access, it is highly recommended to use the console command sudo rather than logging in as root. Since you can use the sudo command and a user password to make root changes, you do not actually need to set a password for root. If you still want to set a password, then read on.

Step 2. Start the Terminal
You will change the password through the Terminal, which can be opened from the Taskbar or by pressing the Ctrl + Alt + T key combination.

Step 3. Enter
sudo passwd and press the key ↵ Enter. You will be asked to enter the user's password.

Step 4. Enter the new root password
When you enter your user password, you will be asked to create a new root password. Enter it twice to confirm the change. When you enter your password, you will not see it on the screen.