10.7 Lion / 10.8 Mountain Lion
Follow the instructions in the beige and green boxes.
http://pondini.org/OSX/Password.html
Note
You should now be able to log in with the new password, but you won't be able to unlock the Keychain. If you've forgotten the Keychain password (which is ordinarily the same as your login password), there's no way to recover it. You’ll need to reset your keychain in the preferences of the Keychain Access application.
http://support.apple.com/kb/TS1544