If you’re locked out of your MAC, follow these steps to reset the password.
First
Step 1 – Restart your Mac, and get ready to boot into OS X Recovery Mode.
Step 2 – While restarting, hold down CMD + R until the Apple logo appears.
Step 3 – Go to Utilities > Terminal to open a Terminal. In the Terminal window, type resetpassword and press Enter.
Now, using the Reset Password Console
Step 1 – Select your OS X drive.
Step 2 – From the drop-down under “Select the user account:”, choose the user account that you want to reset password.
Step 3 – Type in new password.
Step 4 – Once you’re done, click on Save.
Restart and login.
Screenshot
* I tested this on the root account, and it worked fine. If keychain comes up when you try to login, just select “Login”—do not try to enter a password into keychain.