Just happened to come across this...but this will only work assuming you can log in via auto login.
---------------------------------------------------------------------------------
We've all done this.* It's time to install something or run Software Update, but first we've got to enter our password. What was it again? Oops.
You can reset your password with the CD (or DVD) that came with your Mac, but if you don't have it, try this tip from Hackszine. Restart your machine while holding down the Command Key (or "Apple Key") and the "S" key. This will start your Mac up in "Single User Mode."
Now it's command line time.** Don't worry, it's just three lines:
#sh /etc/rc
#passwd yourusername
#reboot
Ta-dah! You may return to what you were originally doing. Just write that new password down first.
*Well, not us, but, you know...our "friend."
[via tuaw][via lifehacker]