The fastest way depends on what you remember and what system you use

If you have forgotten your administrator password, the path forward depends on whether you are on Windows, macOS, or Linux, and whether you set up a password reset disk or recovery email beforehand. Windows lets you reset a local admin password using another admin account or a password reset disk. macOS has a recovery mode that can reset your password if you know your Apple ID. Linux varies by distribution, but usually involves booting into single-user mode or using a live USB. If you locked yourself out completely with no backup method, you may need to reinstall the operating system, which erases everything on the drive.

The key difference is whether you have a recovery method already in place. If you created a password reset disk or linked a recovery email before you forgot the password, you can reset it in minutes. If not, the process takes longer and may require access to another computer or a second admin account on the same machine.

Key Takeaways

  • On Windows, you can reset a forgotten admin password using another admin account, a password reset disk created before you forgot it, or by booting into safe mode if you have physical access to the machine.
  • On macOS, restart in Recovery Mode (Command + R during startup), use Utilities > Terminal, and reset the password through the resetpassword command if you know your Apple ID.
  • On Linux, you can usually boot into single-user mode or use a live USB to mount the drive and reset the root password, depending on your distribution.
  • If you have no recovery method and no other admin account, a clean reinstall of the operating system is often the only option, and it will erase all files on that drive.
  • Creating a password reset disk or recovery email before you forget your password is the easiest prevention — Windows and macOS both offer this during initial setup.

Windows: Using another admin account or password reset disk

If you have a second administrator account on the same computer, log into that account and reset the forgotten password from there. Open Settings, go to Accounts, select the account you locked out, and choose Reset Password. You will be asked to set a new password; you do not need the old one. This is the fastest method if you have access to a second admin account.

If you created a password reset disk before you forgot your password, insert that disk or USB drive into the computer. On the Windows login screen, click Reset Password, and the wizard will walk you through creating a new one. This is the fastest method if you have the disk. The disk must have been created on the same computer and the same account — a reset disk from another machine will not work.

If you have neither a second admin account nor a reset disk, you can try booting into Safe Mode with Command Prompt. Restart the computer and press F8 repeatedly before Windows loads. Select Safe Mode with Command Prompt. At the command line, type net user administrator newpassword (replacing newpassword with what you want). This works only on some Windows versions and only if the built-in Administrator account is still enabled. Many newer Windows installations disable this account by default.

macOS: Recovery Mode and your Apple ID

Restart your Mac and hold Command + R as it boots. This opens Recovery Mode. Once the utilities menu appears, click Utilities in the top menu bar, then select Terminal. Type resetpassword and press Enter. A window will open where you can select your user account and set a new password. You will need to know your Apple ID and password to complete this. The entire process usually takes five to ten minutes.

If you do not remember your Apple ID password, you can reset that through Apple's website before attempting the Mac reset. Go to iforgot.apple.com, enter your Apple ID email, and follow the recovery steps. Once your Apple ID password is reset, return to the Mac recovery process and use the new password. Keep in mind that resetting your Apple ID password through the website may take a few minutes to sync to your Mac.

Linux: Single-user mode or live USB boot

The method varies by distribution. On Ubuntu and Debian-based systems, restart the computer and hold Shift to see the GRUB boot menu. Select the entry that says recovery mode. When prompted, select root to drop into a root shell. Type passwd username (replacing username with the account you need to reset) and enter a new password twice. The system will confirm the password has been updated and you can reboot normally.

If recovery mode is not available or does not work, create a bootable live USB with Ubuntu or another Linux distribution. Boot from the USB, open a terminal, and use the mount command to access your hard drive. Once mounted, you can navigate to /etc/shadow and edit the password hash directly, or use chroot to change into the mounted filesystem and run passwd from there. This requires some command-line comfort and knowledge of your drive's partition layout.

When you have no recovery method: Clean reinstall

If you have no password reset disk, no recovery email, no second admin account, and cannot boot into recovery or single-user mode, a clean reinstall is usually the only remaining option. This means erasing the drive and installing a fresh copy of Windows, macOS, or Linux. All files on that drive will be lost unless you can recover them from a backup. Before you start, check whether you have an external backup of your important files.

To reinstall Windows, read the Windows installation media on another computer, create a bootable USB using a tool like Rufus, and boot from it. Follow the installer and choose to erase the drive when prompted. For macOS, boot into Recovery Mode (Command + R), open Disk Utility, erase the drive, and reinstall macOS from the recovery partition. For Linux, use the same live USB method but select the option to erase and install fresh. After reinstalling, you will need to reinstall your programs and restore your files from backup.

Preventing this: Password reset disk and recovery email

The easiest way to avoid being locked out is to create a password reset disk when you first set up your account. On Windows, open Control Panel, go to User Accounts, and select Create a Password Reset Disk. Store the disk somewhere safe but accessible. On macOS, enable FileVault and save your recovery key somewhere safe, or link your Apple ID to your account during setup. Both of these take less than five minutes and can save you hours later.

On all systems, use a password manager like Bitwarden, 1Password, or KeePass to store your admin password in an encrypted vault. If you forget the master password to the vault, at least you have only one password to recover instead of many. Write down your password recovery questions and answers somewhere find, separate from the password itself. Keep a physical backup of critical recovery codes in a safe place like a safe deposit box.

What happens when you reset the admin password

Resetting your admin password does not affect your files, installed programs, or user data — it only changes the password you use to log in. However, if you had encrypted your drive with BitLocker (Windows) or FileVault (macOS) using that password, you may lose access to the encryption key. If you used the password to encrypt individual files or folders, those remain encrypted and you will not be able to open them without the original password. Check your encryption settings before you reset.

After you reset the password, log in with the new one and change any saved passwords in your browser or password manager, since they were tied to the old password. Update any scripts or scheduled tasks that used the old admin password to authenticate. If you use your admin password to log into cloud services or remote systems, update those credentials as well to prevent lockouts there.

Frequently Asked Questions

Can I reset an admin password without losing my files?

Yes, if you use a password reset disk, another admin account, or recovery mode. These methods change only the password, not the files. A clean reinstall erases everything, so use that only as a last resort.

What if I forgot my Apple ID password too?

Go to iforgot.apple.com and reset it using your recovery email or phone number. Once your Apple ID password is reset, you can use it to reset your Mac password in Recovery Mode.

Does resetting my password unlock encrypted files?

No. If you encrypted files with your old password, resetting the password does not decrypt them. You will need the original password to open those files.

Can I reset the admin password on someone else's computer?

Not without physical access and either a password reset disk, another admin account, or the ability to boot into recovery mode. These safeguards exist to prevent unauthorized access.

What if I do not have a bootable USB or password reset disk?

You can create one on another computer. read the Windows, macOS, or Linux installer on a different machine, write it to a USB drive using Rufus (Windows) or Etcher (macOS/Linux), and use that to boot the locked computer.