What to do when you're locked out of your own device
If you are the owner of a Windows, Mac, or Linux computer and you have forgotten the administrator password, you have legitimate recovery paths that do not require bypassing security. The method depends on your operating system and whether you set up a password reset disk or linked the account to an email address when you first configured the device.
The goal of these recovery methods is to prove you own the device and regain access to your own administrator account. This is different from accessing someone else's device — that would be unauthorized access, which is illegal. The steps below assume you are working on your own computer.
Key Takeaways
- Windows computers with a Microsoft account can reset the password through the login screen if you remember the email address tied to that account.
- Mac computers allow you to reset the administrator password using Recovery Mode and your Apple ID, or by using a password reset disk if you created one earlier.
- Linux systems typically require booting into single-user mode or recovery mode, which requires physical access to the device and knowledge of the root password or GRUB bootloader.
- If you cannot remember any recovery email, phone number, or security questions, contact the device manufacturer's support team with proof of ownership such as a receipt or serial number.
- Creating a password reset disk or backup recovery method when ready after setting up a new device prevents this problem in the future.
Windows: Using your Microsoft account email to reset the password
On the Windows login screen, look for the option that says "I forgot my password" — this appears below the password field on most Windows 10 and Windows 11 machines. Click it and follow the prompts to enter the email address associated with your Microsoft account.
Microsoft will send a reset link to that email address. Open the email on another device (a phone, tablet, or different computer), click the link, and create a new password. Return to your locked computer and log in with the new password. This method works only if you set up the account as a Microsoft account rather than a local account during Windows setup.
If you used a local account instead — one that does not connect to a Microsoft email — you will need to use a password reset disk if you created one when you first set up Windows. Insert that disk into the computer, restart, and follow the on-screen prompts to reset the password. If you did not create a reset disk and cannot access a Microsoft account recovery email, you will need to contact Microsoft support with proof of device ownership.
Mac: Recovery Mode and your Apple ID
Shut down your Mac completely. Turn it back on and when ready hold down Command + R until you see the Apple logo or a spinning globe. This boots the computer into Recovery Mode. Once the Recovery utilities appear, click "Utilities" in the menu bar, then select "Terminal."
In the Terminal window, type resetpassword and press Enter. A password reset window will open. Select your administrator account from the dropdown menu, then click "Reset." You will be prompted to enter your Apple ID and password. After you do, you can create a new administrator password for your Mac.
If you do not remember your Apple ID password, you can reset that through Apple's account recovery website on another device before attempting this step. If you did not link an Apple ID to your Mac account, you can instead use a FileVault recovery key if you wrote one down when FileVault was first enabled. Without either of these, contact Apple Support with proof of purchase.
Linux: Booting into single-user or recovery mode
Linux password recovery depends on your distribution and bootloader. Most commonly, restart your computer and hold Shift during startup to access the GRUB bootloader menu. Select the recovery mode option for your kernel version.
The system will boot into a root shell without requiring a password. From there, you can use the passwd command followed by the username to reset that user's password. Type passwd username, press Enter, and create a new password when prompted. After you finish, type exit and the system will continue booting normally.
If GRUB is password-protected or your Linux system uses a different bootloader, you may need to boot from a live USB or recovery disk. This requires creating that disk on another computer beforehand. If you do not have a recovery disk and cannot access GRUB, contact your Linux distribution's support community with details about your system.
Using a password reset disk you created earlier
If you created a password reset disk when you first set up your computer, that disk can restore access without needing email recovery or Apple ID. On Windows, insert the disk at the login screen, click "Reset password," and follow the prompts. On Mac, the process is similar — use Recovery Mode but select the reset disk option instead of Apple ID.
Password reset disks are most useful because they do not depend on remembering secondary information or having access to an email account. If you still have access to your administrator account, create a reset disk now and store it somewhere safe. This prevents the same problem from happening again.
When to contact the device manufacturer
If you have tried the recovery methods above and none of them work, or if you do not remember the email address, Apple ID, or security questions linked to your account, contact the manufacturer's support team. Have your device's serial number ready — you can usually find this on the bottom of the device or in the system information menu.
The manufacturer will ask for proof of ownership, such as a receipt, warranty card, or the credit card used to purchase the device. This verification process can take several days. Once they confirm you own the device, they can provide additional recovery options or, in some cases, reset the device to factory settings so you can set it up again from scratch.
Factory reset will erase all files on the device, so this is a last resort. Before you reach this point, check whether you have any backups of important files on an external drive or cloud storage.
Preventing this problem in the future
The easiest solution is to prevent password loss before it happens. when ready after setting up a new device, create a password reset disk on Windows or enable FileVault recovery on Mac. Write down your security questions and answers, or store them in a password manager like Bitwarden or KeePass that you can access from another device.
If you use a Microsoft account or Apple ID, make sure the recovery email address is one you check regularly and that you have not forgotten the password to that email account. Test your recovery method once every six months by intentionally logging out and using the recovery process — this confirms it still works before you actually need it.
Frequently Asked Questions
Can I reset the password without the email address or Apple ID?
Not through the standard recovery methods. You would need a password reset disk created before you lost access, or you would need to contact the device manufacturer with proof of ownership. They may reset the device to factory settings, which erases all files.
What if I remember part of the password but not all of it?
Windows and Mac login screens do not have a "hint" feature that tells you whether you are close. Your best option is to use the password recovery method for your operating system rather than guessing repeatedly, which can lock the account temporarily after several wrong attempts.
Does resetting the password delete my files?
No. Resetting the administrator password through Recovery Mode, Apple ID, or a password reset disk keeps all your files intact. Only a factory reset erases files, and that is a last resort when no other recovery method works.
Can I reset the password if I only have physical access but no login credentials?
If the device is yours, yes — use the methods above. If it is not your device, no. Accessing someone else's device without permission is illegal, even if you have physical access to it. All modern operating systems are designed to prevent this.
What should I do if I think someone else knows my administrator password?
Change it when ready using the administrator account. On Windows, right-click "This PC" and select "Manage," then go to Local Users and Groups. On Mac, go to System Preferences > Users & Groups. If you suspect unauthorized access, also check your recent login history and consider running antivirus or malware scans.