Reset Mac OS X Admin Password With Command

To reset your OS X password without an OS X CD you have two ways.
First Way:
1.First Way “create a new admin account”
2.Reboot
3.Hold apple + s down after you hear the chime.
4.When you get text prompt enter in these terminal commands to create a brand new admin account (hitting return after each line): 
5.mount -uw /
6.rm /var/db/.AppleSetupDone
7.shutdown -h now
8.After rebooting you should 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 again!
9.Second way “Resetting or changing your existing password”.


 Second Way:

1.If you’ve ever forgotten your user account password in OS X, All you need is to remember your 2.username (you do remember that, right?) and then reboot your computer.
3.Hold apple + s down after you hear the chime.
4.sh /etc/rc
5.password yourusername
6.reboot.