The administrator account of a computer allows you to have total control of the system, which allows you to change the configuration of the operating system and make changes to the file system. Regardless of the operating system your computer is using, you can change the system administrator account password using the command line. On Windows systems, the administrator account is disabled by default and must be activated before it can be used.
Steps
Method 1 of 3: Windows

Step 1. Understand the difference between the different types of manager accounts
The Windows installation procedure automatically creates and disables a system administrator account in all versions of the operating system released after Windows XP. The Windows administrator account is disabled for security reasons, as the first user account that is created will itself be a computer administrator by default. The procedure described in this method details how to activate the Windows administrator account and set a security password.
If you need to change your user account password, you can do so by logging into the "Control Panel" and selecting the "User Accounts" icon. At this point, select your account and click on the "Create password" or "Change password" link

Step 2. Press the button
⊞ Win and type in the keyword "cmd".
You will see the "Command Prompt" icon appear in the results list.

Step 3. Select the "Command Prompt" icon with the right mouse button and choose the "Run as administrator" option

Step 4. Type the command
net user administrator / active: yes and press the button Enter.
This will enable the use of the Windows administrator account. The reason why you normally enable the Windows administrator account is to prevent the "Check User Account" program confirmation messages from being displayed when you perform operations that change the configuration settings of the operating system.

Step 5. Type the command
net user administrator * and press the button Enter.
This will give you the ability to change the password of the computer administrator account.

Step 6. Enter the password you want to use
For security reasons, when entering the password, the characters entered will not be displayed on the screen. Press the Enter key after entering the password you want.

Step 7. Re-enter the password to confirm it is correct
If the two passwords you entered are not identical, you will need to re-enter them.

Step 8. Type the command
net user administrator / active: no and press the button Enter.
This will disable the system administrator account again. It's always best to disable the computer administrator account when you don't need to use it. After setting the security password correctly and performing all the operations you needed to perform using the system administrator account, disable it using the "Command Prompt".
Method 2 of 3: Mac

Step 1. Understand how the procedure works
To reset your Mac administrator account password, you can use "Single User Mode". To perform the steps in this method, you do not need to log in to the Mac as an administrator.

Step 2. Restart your computer while holding down the key combination
⌘ Command + S.
Pressing the indicated key combination while the Mac is starting up will bring up the operating system command line.

Step 3. Type the command
fsck -fy and press the button Enter.
Your Mac's hard drive will be scanned for errors. This step will take a few minutes to complete. This is a mandatory step before you can continue.

Step 4. Type the command
mount -uw / and press the button Enter.
This will give you the ability to make changes to the Mac's file system.

Step 5. Type the command
passwd Administrator and press the button Enter.
You can use this command to change the password of any user account on the Mac, replacing the "Administrator" parameter as the corresponding name.

Step 6. Enter the new security password twice
You will be asked to enter your new password twice to confirm that it is correct. While typing the password, you will not see the characters entered on the screen.

Step 7. Type the command
reboot and press the button Enter.
The Mac will restart and the operating system will load as it normally does. At this point you can use the administrator account by entering the new password you have set.
Method 3 of 3: Linux

Step 1. Understand the risks involved with this procedure before continuing
The Linux operating system is designed to allow the user to perform any type of operation, without having to log in using the "root" user, ie the system administrator. For this reason, all experts recommend using the sudo command to perform all operations that require administrative access to the system, instead of logging in with the "root" user. Since you can use the sudo command in conjunction with your user account password, there is no need to change the "root" account password.

Step 2. Open a "Terminal" window
You can change the password of the accounts directly using the Linux "Terminal" window which can be opened by pressing the key combination Ctrl + Alt + T.

Step 3. Type the command
sudo passwd and press the button Enter.
You will be asked to enter your user account password.

Step 4. Enter the new password of the "root" account
After entering your account password, you will be prompted to enter the new "root" account security password. You will have to enter it twice to check it is correct. While typing the password, you will not see the characters entered on the screen.