How to Reset MacOS Password with Terminal

May 11, 2021 - 8 Comments

How to Reset MacOS Password with Terminal

Can’t log in to your Mac because you forgot or lost your user password? That can be stressful, but don’t freak out quite yet. Whether it’s your primary admin password or password to a standard user account on someone else’s mac, you can reset it in a couple of minutes.

While you can use an Apple ID to quickly reset a Mac password, that’s simply optional and not enabled by default, so many Mac users may not even be aware that is an option, let alone have it enabled. In such cases, if you forget your user password, you’ll have to resort to other ways to regain access to your admin or standard user account.

This article will be guiding you through the steps to reset a macOS password with Terminal via Recovery Mode, and it works with macOS Big Sur, Catalina, Mojave, High Sierra, and other recent MacOS releases.

How to Reset a MacOS Password with Terminal via Recovery Mode

This method to reset your Mac’s user password is applicable to all the recent versions of macOS, and doesn’t require to type any complicated commands in Terminal. Simply follow the steps below to get started.

  1. Click on the Apple logo at the top-left corner of your desktop and choose “Restart” from the dropdown menu. If you’re stuck in the login screen, you’ll find the restart option right below the password field.

    How to Reset MacOS Password with Terminal
    • On Intel Macs: As soon as the screen turns back on, start holding Command + R keys to boot your Mac into Recovery mode.
    • On ARM Macs: after reboot immediately hold down the Power button to access Recovery Mode, then choose “Options”

    How to Reset MacOS Password with Terminal

  2. Pull down the Utilities menu option, then choose “Terminal” from the dropdown menu, as shown in the screenshot below.

    How to Reset MacOS Password with Terminal
  3. Once Terminal opens up, type “resetpassword” without the quotes and hit the Return key.

    How to Reset MacOS Password with Terminal
  4. This will launch the Recovery Assistant where you’ll be able to reset your Mac’s user password. Type in your new preferred password, choose a hint, and then click “Next”. You’ll be prompted to reboot your Mac and once it restarts, you can log in with the new password.

    How to Reset MacOS Password with Terminal

That’s how you can reset a Mac’s password without having to rely on using an Apple ID.

Remember, you will lose access to your old Keychain data and won’t be able to unlock your login Keychain. This is because your Keychain password is typically the same as your Mac user password, but since you’ve reset it, the passwords no longer match. You’ll just need to reset your default Keychain from the Preferences menu in Keychain access.

Although you can reset your Mac’s user password with a boot drive or by booting into single-user mode and removing a setup file, this is the simplest way to reset the password if you didn’t associate your Apple ID to the user account.

Already linked your Apple ID to the user account? If so, you might be interested to learn how easy it is to reset your Mac’s password with just your Apple account. There’s no need to boot into recovery mode for that method, and it’s by far the simplest way to reset a Mac password. Of course if you also forgot your Apple ID login, then you can reset your Apple account’s password from the web by answering the security questions you set while creating the account too.

If you’ve long used an Intel Mac but moved to a newer Mac hardware, you’ll likely find that accessing Recovery Mode on Apple Silicon ARM Macs is new to you, but once you learn the new Power button approach everything else is pretty similar.

Did you reset the Mac password using the command line and this approach? Did you find another solution? Share your experiences and tips in the comments.

.

Related articles:

Posted by: Hamlin Rozario in Command Line, Mac OS, Tips & Tricks, Troubleshooting

8 Comments

» Comments RSS Feed

  1. Longdd says:

    Only work if your Mac’s users not linked with any Icloud account,

  2. Bob Patterson says:

    If you do not have a Firmware Pass word set on your Mac then any one can access if you lose your machine or if it is stolen. So be aware this article points out a security weakness in the operating system.

  3. Ken says:

    This is rather disturbing in a way. Does this mean that anyone who gets hold of my Mac can access my data on it by changing the password from the Terminal?

  4. David Batten says:

    The article seemed to be offering something desirable (recover from lost password) but it raises the issue of the ‘keychain’ no longer working. How do we recover from THAT? ! I’m unfamiliar with Keychains and why they are important and how a broken one can be recovered/re-constituted.

  5. Maximilian says:

    Does this mean, that if someone has my MacBook gets access to all stored data in a minute?

  6. PMH says:

    This is very worrisome. If I understand this correctly, it means that anyone with physical access can reset my account password and gain access to all the information stored in my account. I no longer actually have account protection. Is that correct?

  7. NotarySojac says:

    Is there a step missing? Which account does this change the password on?

  8. Peter says:

    Why not simply use the passwd utility form a terminal session on a MacBook?

    It sounds as though you’re dealing with users who have never used a CLI…

    You may recall, that’s all there was before GUIs came along!

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site