1. Boot to single user mode by restarting and after the chime press and hold down the COMMAND-S keys until a black screen with white type appears.
2. At the prompt, type the following commands pressing return after each command line:
/sbin/fsck -yf
If you do not receive a "Filesystem OK" message then repeat this command until you do. If after seven tries you still do not receive a "Filesystem OK" message, then the system is corrupted and needs to be reinstalled.
mount -uw /
cd /private/var/db/netinfo
mv local.nidb local.old
rm ../.AppleSetupDone
shutdown -r now
The second-to-last command above will cause OS X to think that the operating system is newly installed, and when the new owner starts up the computer it will send him/her to the startup wizard where he/she can start a new user without reinstalling.