To reset your OS X password without an OS X CD you need to enter the terminal and create a new admin account

1. Reboot
2. Hold apple + s down after you hear the chime.
3. When you get a text prompt enter in these terminal commands to create a brand new admin account (hitting return after each line):
       mount -uw /
       rm /var/db/.AppleSetupDone
       shutdown -h now
4. After rebooting you will be given setup steps as if the operating system has reset, you should then have a brand new admin account. When you login as the new admin you can simply delete the old one and you’re good to go!

 

Note: These instructions are no longer supported in new machines. In order to reset an OS password, you can follow instructions from the Apple website, click here

Note2: Resetting the password with this method, will not give you access to the Startup Security Utility in the firmware until you re-install the macOS.