If you forgot your password don’t worry you can easily get back your lost password

Resting your forgotten password is only 5 step away.

You need to boot your system into single user mode now Press command-S at power on to bring your system
into single user mode.

Now first check your file system consistency.

fsck -fy

After that we need to mount our root file system

mount -uw /

Load com.apple.DirectoryServices.plist

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

Use the command line utility “dscl” to reset your user’s password.

dscl . -passwd /Users/username password

Just replace user name with the targeted user and password as you like.

Reboot your system

This allows you to reset your password in single user mode without booting from CD/DVDrom