Command To Force OS X to Re-Run Setup

Every so often, I find myself troubleshooting a Mac where I don't have a password to login.

As long as the person hasn't encrypted the hard drive, you can re-run the Mac Setup Assistant to create a new admin account without having to reset anyone's password. 

In Terminal or Single-User Mode, run the following command.

rm /var/db/.AppleSetupDone 

You can then reboot the computer and create a new admin account without affecting any other accounts.