Photo: guteksk7 / Shutterstock.com
Unlocking your Mac when you forget the password can be a tricky situation. It happens to the best of us, and it’s incredibly frustrating when you can’t access your computer. However, there’s no need to panic. Apple provides a way to reset your Mac password using the Terminal.
In this article, we have discussed the steps to reset your Mac password using the Terminal if you are stuck on the login screen.
Also read: How to change OpenAI password?
Reset password through the Terminal
There are several methods to reset your Mac password; one is resetting your password through the Terminal. To reset your password through the terminal, follow the steps below.
Step 1: If you are on the login screen, you must restart your Mac.
Step 2: When your Mac turns on, press and hold Command + R key until the Apple logo appears on the screen.
If you see the login screen again, you were late to press the buttons; you will have to restart and repeat the process until you reach the recovery screen.
Step 3: The macOS Utilities window will appear with options like Restore from Time Machine, Reinstall macOS and Disk Utility. In the menu bar, click on the Utilities menu and then click on the Terminal option in the dropdown menu.
Step 4: In the terminal window, type
resetpassword and hit the Return button on your keyboard.
Step 5: In the reset password window, type the new password, verify it and type a password hint, which will come in handy when you forget the password and then click on the Next button.
If you have multiple user accounts or an older Mac, you’ll need to choose Forgot all passwords first and then pick the specific user account for which you wish to reset the password. Then, click on the Apple icon located in the upper-left corner, and from the drop-down menu, choose Restart to finish the process.
Step 6: Now, click on Restart, and proceed to the Login screen, where you’ll find the admin user whose password you just reset. Enter your newly created password for that account and click Enter to complete the process.