This is a Hack that is quite dangerous if you have lost your Mac and someone is trying to use your account and its content. On the other hand it is very useful if you have forgotten your password.
Important Note: If your Mac OSX password is tied to the Apple iCloud account then this trick might not resolve your situation and you might have to go through the procedure of resetting your iCloud/Apple ID password via Internet.
Here are the steps:
- Click the Apple menu, Select Restart…
- Hold down Command key and R key before and while the booting sound occurs and keep it that way till you see the Apple logo. Then you can release the keys.
- Into the Recovery System, Click the Utilities menu and select Terminal.
- In the terminal, type resetpassword and press return.
- You will get presented with a window where you can select the user change its password.
- When finished, close the Terminal app.
Click the Apple menu and select Restart…