My Service Support

Reset Mac Password from Terminal: Step-by-Step Guide

Updated 2026-08-21 · 1041 words

Be the first to rate this page

To reset a forgotten Mac login password with Terminal, start the Mac in macOS Recovery, open Terminal, enter the confirmed command resetpassword, and follow the Reset Password assistant. This changes the login password for an account you are authorized to access; it does not require reinstalling macOS or erasing the Mac.

Why use Terminal to reset a Mac password?

Terminal in macOS Recovery is a fallback when the login window does not show a usable password-reset option. First try restarting the Mac and entering the password up to three times, because macOS may then display an option to reset it with an Apple Account or a FileVault recovery key.

If those choices never appear or cannot be completed, Apple’s documented OS X password reset Terminal procedure opens the Reset Password assistant from Recovery. Terminal is a text-based utility that runs commands; macOS Recovery is the Mac’s built-in troubleshooting environment.

Use this process only on your own Mac or on a Mac you are authorized to manage. It does not bypass FileVault encryption, Activation Lock, a firmware password, or account verification.

What do you need before resetting a Mac password?

  • Physical access to the Mac and its keyboard. Startup keys can be difficult to register on some wireless keyboards, so use the built-in keyboard or a connected keyboard when possible.

  • The Mac’s processor type. Apple silicon Macs use the power button to enter Recovery; Intel-based Macs use Command-R during startup.

  • Information that proves account access. Depending on the Mac’s setup, Recovery may request an Apple Account password, a verification code, another administrator’s password, or a FileVault recovery key.

  • The correct startup disk and user name. The startup disk is often named Macintosh HD, but it may have been renamed.

  • An understanding of FileVault. FileVault encrypts the startup disk, so Recovery must unlock the disk before it can change an account password.

You do not need to erase the startup disk for this procedure. Do not select Disk Utility’s erase controls, and do not reinstall macOS merely to run the password assistant.

How do you reset the password in Terminal step by step?

  1. Shut down the Mac completely.

  2. On a Mac with Apple silicon, press and hold the power or Touch ID button until startup options appear. Select Options, then Continue. On an Intel-based Mac, turn it on and immediately hold Command-R until an Apple logo or spinning globe appears.

  3. If Recovery asks for a startup volume, select the volume containing macOS. If it asks for a known user password, look for the option indicating that all passwords were forgotten, then follow the prompts first.

  4. When the Recovery utilities window appears, open the Utilities menu at the top of the screen and select Terminal.

  5. Type resetpassword as one word in lowercase, then press Return. This is the command Apple documents for the OSX reset password Terminal workflow.

  6. In the Reset Password window, choose the option that says you forgot the password or that the password does not work. Select the correct startup disk and user account when prompted.

  7. Complete any requested verification. Enter the new password twice and add a useful hint that does not reveal the password.

  8. Quit Terminal, restart the Mac from the Apple menu, and sign in with the new password.

The exact screens vary by macOS version and security setup. If the assistant offers to reset more than one account, check each displayed user name carefully before continuing.

Should you use single-user mode or Recovery Mode?

  • Recovery Mode: This is the supported approach for current Macs. It provides the Reset Password assistant and can request the credentials needed to unlock an encrypted startup disk.

  • Single-user mode: This older Intel Mac environment started from a command-line screen with Command-S. Apple states that Command-S single-user startup is disabled in macOS Mojave and later, so old command sequences found elsewhere may not apply and should not be used.

  • Apple silicon: Command-S is not the startup method. Shut down, hold the power button until startup options appear, then choose Options to enter Recovery.

  • Older Intel Macs: Even when an older system supports single-user mode, Recovery Mode and the documented resetpassword assistant are safer because they account for the Mac’s configured security controls.

For searches such as “reset password osx terminal,” instructions written for older OS X releases may describe commands that no longer match modern disk layouts or security protections.

What should you do if Terminal commands do not work?

  • If Terminal says the command is not found, confirm that you entered resetpassword as one lowercase word and that Terminal was opened from macOS Recovery, not from another startup environment.

  • If the startup disk or user is missing, quit the assistant and check whether Recovery can see the correct internal volume. Do not erase, rename, or reformat the volume.

  • If FileVault requests a recovery key, the password cannot be reset until the encrypted disk is unlocked through an accepted recovery method.

  • If Command-R does not open Recovery on an Intel Mac, shut down and retry with the built-in or a connected keyboard. A firmware-password lock can also prevent access to alternate startup modes.

  • If Apple Account verification fails, the Mac shows Activation Lock, the recovery key is unavailable, or the disk reports a hardware problem, stop attempting unrelated commands. Contact Apple Support or an authorized administrator and be ready to establish ownership or account access.

How do you secure your account after resetting the password?

Create a long, unique password that is not reused for another account. Store it in a trusted password manager, and make the password hint meaningful only to you.

A password reset may leave the existing login keychain locked because that keychain can still be protected by the old password. If macOS asks for the previous password and you cannot provide it, follow the system prompt to create a new login keychain. Saved passwords and other secrets in the inaccessible keychain are not automatically recovered by changing the Mac login password.

Confirm that you can restart and sign in before changing other security settings. FileVault normally does not need to be disabled for this reset. If an authorized administrator had deliberately turned it off, re-enable it only after confirming account access and securely recording the new recovery information.

Was this page helpful?

Be the first to rate this page