I’ve gotten a couple of questions about this and don’t remember where I posted it previously, so here goes again. If you forget a local admin password in OS X and you have physical access to the machine then unless you’re using full disk encryption or firmware passwords (and know those passwords) you can reset the password. To do so boot the computer or server from your recovery partition using Command-R at boot (or Option and then selecting the recovery partition).
At the Recovery Desktop open Terminal from the Utilities menu. From terminal use the following command:
When the Reset Password window appears, choose the volume you’d like to reset an account password for and then choose the username from the Select menu. Then enter the new password twice and click Save. Reboot and you should be able to login. At the first login you’ll likely want to reset the keychain as well, when prompted.