To reset a Mac password from Terminal, start up from macOS Recovery, choose Terminal from the Utilities menu, type resetpassword and press Return. That opens the Reset Password window, which sets a new login password. The command isn’t available in a normal macOS session; it only works after booting into Recovery, where that binary actually lives.
Apple treats Terminal as a fallback. Its article If you forgot your Mac login password (dated September 22, 2026) starts at the login window, where a question mark or a message such as “Reset Password” or “Restart and show password reset options” can appear after up to three wrong passwords. I’d try that first.
Table of Contents
Reset your Mac password from Terminal in macOS Recovery
1. Start up from macOS Recovery
Shut the Mac down. If it won’t, hold the power button (Touch ID on laptops) for up to 10 seconds.
- Apple silicon (every Mac that runs macOS 27 Golden Gate): press and hold the power button until you see “Loading startup options” or the Options icon, release it, then click Options and Continue.
- Intel (macOS Tahoe 26 or earlier): press and release the power button, then immediately hold Command (⌘)-R until you see an Apple logo or a spinning globe. Option-Command-R or Shift-Option-Command-R forces Internet Recovery.
Not sure which you have? Apple says it’s safe to try both.
2. Choose “Forgot all passwords?”
When Recovery asks for a user you know the password for, click “Forgot all passwords?”. Depending on how the Mac is set up, it asks for the Apple Account (formerly Apple ID) used on this Mac or your FileVault recovery key. It may also ask to deactivate the Mac, which Apple says is temporary. If it lets you set a new password, do that and restart; otherwise click Exit to Recovery.
3. Run resetpassword
- From the Utilities menu in the menu bar, choose Terminal.
- Type
resetpasswordand press Return. - Select “I forgot my password” or “My password doesn’t work when logging in”, then click Next.
- Give it the information it asks for, then create a new password for your account and any other user accounts.
- Choose Restart from the Apple menu and log in with the new password.
I checked only two things myself, both on macOS 26.6: that resetpassword isn’t found in a normal Terminal session, and what sysadminctl‘s built-in help says about the admin command below; the Recovery steps and window labels follow Apple’s documentation, and I haven’t tried anything on macOS 27.
What a reset does to FileVault and your keychain
FileVault. With FileVault on, you reset a forgotten password with your Apple Account, if FileVault was set up to use your iCloud account, or with the FileVault recovery key. That key is 24 letters and numbers, never contains I, S, 1 or 0, and isn’t your 28-character Apple Account recovery key. If the locked Mac runs macOS Tahoe 26 or later, a lost key may be in the Passwords app on another device using the same Apple Account with iCloud Passwords & Keychain on: search for “recovery key”. If you can’t reset the password and have also lost the key, Apple says your files and settings are lost forever.
Login keychain. It normally shares your login password, and after a reset it still expects the old one. If you know it, enter it when macOS asks for the keychain password. If you don’t, everything in the old keychain is out of reach and macOS starts a new, empty one, which Apple says to allow. Passwords synced with iCloud Keychain also live on your other Apple devices and in iCloud.
Reset another user or admin password from System Settings or Terminal
If you can log in to any administrator account, you don’t need Recovery. Choose Apple menu > System Settings > Users & Groups, click the Info button next to the user, then click Reset. Change is for your own password and asks for the old one.
From Terminal, use sysadminctl. Its built-in help documents this form and recommends passing - so it prompts for passwords, “for security reasons”:
sysadminctl -resetPasswordFor <user> -newPassword - -adminUser <admin> -adminPassword -
Either way, that user loses their old keychain items unless they can enter the old password. Plain passwd can’t fix a forgotten password: unless you’re root, it asks for the current one and won’t continue without it.
Which reset route fits your situation
| Situation | Route | You’ll need | You lose |
|---|---|---|---|
| You can log in to an admin account | Users & Groups > Reset, or sysadminctl |
That admin’s name and password | The reset user’s old keychain items |
| Forgot your own password, FileVault on | Login-window reset, then “Forgot all passwords?”, then resetpassword |
The recovery key, or your Apple Account if it can unlock the disk | Old keychain items |
| Forgot your own password, FileVault off | The same routes | Your Apple Account (at the login window, only if “Allow user to reset password using Apple Account” is on) | Old keychain items |
| Work or school Mac | Ask IT first | IT’s help: they may hold the recovery key, and Recovery may be password-locked | Old keychain items |
| Nothing works | Erase the Mac from Recovery | Your Apple Account, if Activation Lock is on | Every account and its data |
Fix what blocks a Mac password reset
| What you see | Why | What to do |
|---|---|---|
zsh: command not found: resetpassword |
You ran it in a normal session | Start up from Recovery and use its Terminal |
| No question mark or reset message | It can take up to three wrong passwords to appear; the lock screen of a logged-in session has none | Restart, try again at the login window, then use Recovery |
| A lock icon and password field when starting Recovery (Intel) | A firmware password | Enter it. If it’s forgotten, Apple’s answer is an in-person service appointment, with proof of purchase |
| Recovery won’t open without a password on a work Mac (Apple silicon) | A recoveryOS password set through device management | Only IT can supply or remove it |
| “A recovery key has been set by your company, school, or institution” | Your organization created the FileVault recovery key | Ask the administrator to unlock the Mac with it, then reset your password |
| Activation Lock asks for someone else’s Apple Account | The previous owner’s Find My is still on | They need to remove the Mac at iCloud.com/find; on an organization-owned Mac, IT can turn it off |
Erase the Mac if no reset works
Erasing is Apple’s last resort, and it permanently removes every user account, its password and its data. In Recovery, at the prompt for a user you know the password for, choose Erase Mac from the Recovery Assistant menu, then click Erase Mac twice to confirm. If Activate Mac appears afterwards, connect to Wi-Fi, enter your Apple Account details (not your Mac login), then click Exit to Recovery and reinstall macOS.