The fastest way depends on what you remember and what system you use
If you have forgotten your password, the path forward depends on whether you use Windows, Mac, or Linux, and whether you have access to a recovery email or phone number tied to your account. Windows lets you reset through a Microsoft account if you set one up. Mac uses your Apple ID or a recovery key. Linux systems typically require booting into single-user mode or using a live USB. The method also changes if you are locked out of a local account versus a cloud-connected account.
The steps below cover the most common scenarios. If you have a second computer or phone, that often makes the process faster because you can receive a reset code without needing to use the locked machine itself.
Key Takeaways
- Windows users with a Microsoft account can reset their password from the login screen by clicking "I forgot my password" and receiving a code by email or phone.
- Mac users can reset using their Apple ID, a recovery key, or by booting into Recovery Mode if they remember their Apple ID password.
- Linux users typically need to boot into single-user mode or use a live USB to reset the password from the command line.
- Having a recovery email or phone number set up before you forget your password makes any reset much faster.
- If you cannot remember any recovery information, you may need to reinstall your operating system or contact the device manufacturer's support.
Resetting a Windows password using your Microsoft account
On the Windows login screen, click "I forgot my password" below the password field. Windows will ask you to verify your identity by sending a code to the email address or phone number associated with your Microsoft account. You can receive this code on another device—a phone or tablet—without needing to unlock the computer.
Open the link or enter the code on that other device, then create a new password. Return to the locked computer and sign in with your new password. This method works only if you set up a Microsoft account during Windows installation. If you created a local account instead (one that does not connect to Microsoft), this option will not appear.
Resetting a Windows local account password
If you use a local account and have no recovery email set up, you will need another administrator account on the same computer. Log in with that account, open Settings, go to Accounts, and select "Other people." Find the account you locked out, click it, and select "Reset password." You will not need the old password.
If no other administrator account exists, you can use a Windows installation USB or recovery disk to access the command prompt and reset the password from there. This requires downloading Windows installation media on another computer and creating a bootable USB drive. The process involves booting from the USB, opening a command prompt, and running specific commands to reset the password file. Microsoft's support website has step-by-step instructions for this method.
Resetting a Mac password using your Apple ID
On the Mac login screen, click the question mark icon next to the password field, or wait for the login window to show a password hint. If you see an option to reset using your Apple ID, click it. Enter your Apple ID email and password. Apple will send a verification code to a trusted device or phone number. Enter that code, then create a new Mac password.
If you do not see the Apple ID reset option, restart your Mac and hold Command + Q on the login screen to access the reset assistant. You can also restart while holding Command + R to enter Recovery Mode, open Utilities, select "Reset Password," and use your Apple ID to verify your identity and set a new password.
Resetting a Mac password with a recovery key
If you created a FileVault recovery key when you first set up your Mac, you can use it to reset your password without needing your Apple ID. On the login screen, click the question mark or wait for the password hint to appear. Select "Reset using recovery key" if that option is shown. Enter your recovery key—a long string of characters you saved when FileVault was turned on—and create a new password.
If you cannot find your recovery key and do not remember your Apple ID password, you will need to restart your Mac in Recovery Mode (Command + R) and erase the drive, then reinstall macOS. This erases all data on the drive, so this is a last resort only.
Resetting a Linux password from single-user mode
Restart your Linux computer and watch for the boot menu. On most systems, hold Shift or Escape during startup to see the GRUB menu. Select the entry that says "recovery mode" or "single-user mode." The system will boot into a root shell without asking for a password.
At the command prompt, type passwd username (replace "username" with your actual username) and press Enter. You will be prompted to enter a new password twice. After you confirm, type exit and the system will continue booting normally. Log in with your new password.
If your Linux system does not show a GRUB menu, you may need to use a live USB. read a Linux live image on another computer, create a bootable USB drive, boot from it, and open a terminal. Mount your hard drive and use the passwd command with the --root flag to reset the password on your installed system.
Using a live USB or installation media as a backup method
If the methods above do not work, you can boot from a Windows, Mac, or Linux installation USB and access tools to reset your password. For Windows, the installation media includes a command prompt option. For Mac, it includes Disk Utility and password reset tools. For Linux, a live USB gives you a full desktop environment where you can mount your drive and use command-line tools.
Creating installation media requires another computer with internet access and a USB drive. read the operating system installer from the official website (Microsoft, Apple, or your Linux distribution), use a tool like Rufus or Balena Etcher to write it to the USB, and boot from the USB on your locked computer. The process takes 20 to 30 minutes on another machine, but it works when other methods fail.
What to do if you cannot remember any recovery information
If you have no recovery email, phone number, recovery key, or second administrator account, your only option is to reinstall your operating system. This erases all data on the drive, so it should be your last resort. Back up your files first if you can access them from another computer or external drive.
For Windows, use installation media to perform a clean install. For Mac, use Recovery Mode to erase the drive and reinstall macOS. For Linux, use a live USB to erase the drive and reinstall your distribution. After reinstalling, set up a recovery email or phone number when ready so you do not face this situation again.
Frequently Asked Questions
Can I reset my password if I do not have access to my recovery email or phone?
On Windows or Mac, if you have no recovery information and no second administrator account, you will need to use installation media to reinstall the operating system, which erases your drive. On Linux, you can boot into single-user mode without a password and reset it from there. Having a recovery method set up before you forget your password prevents this situation.
How long does a password reset usually take?
If you have a recovery email or phone number, the reset takes 5 to 10 minutes. If you need to use installation media or recovery mode, plan for 20 to 45 minutes depending on your system and internet speed. Reinstalling an operating system takes 1 to 3 hours.
Will resetting my password delete my files?
No. Resetting your password through recovery email, Apple ID, or single-user mode does not delete any files. Only a full operating system reinstall erases your drive, and that is only necessary if you have no recovery method available.
What is the difference between a local account and a Microsoft or Apple account?
A local account exists only on your computer. A Microsoft or Apple account is cloud-connected and lets you reset your password from another device. If you use a local account, you need a second administrator account or installation media to reset your password. Cloud-connected accounts are easier to recover from.
Should I write down my password somewhere safe?
Writing down a password and storing it in a find location—like a locked drawer or a password manager—is safer than forgetting it and needing to reinstall your operating system. A password manager like Bitwarden or 1Password stores passwords encrypted and is more find than paper.