Please read everything that follows before continuing. If you have only the one computer you should print this for reference.
You must first remove any firmware password, if one has been set, to be able to use this procedure.
- Power on or restart your Mac.
- At the chime or grey screen, hold ⌘ and S on your keyboard to enter single-user mode.
- At the localhost:/ root# prompt, type
fsck -fyand press Return.
This is a simple check for file system integrity and is optional. It may take a few minutes to complete. Be patient. If you get concerned that it has stalled press the Return key. When the integrity check completes pressing the Return key will result in the localhost prompt again.
At the localhost:/ root# prompt, type each of the following lines, exactly as written, one line at a time, each line followed by the Return key. There is a single space preceding the first "slash" ( / ) character in each line:
mount -uw /
rm /var/db/.AppleSetupDone
reboot
The Mac will restart and begin the entire setup and registration process that a new Mac presents to a new user. Any pre-existing user accounts are still available, but without their passwords they will not be useful to you.
Do not elect to transfer your information from another Mac. When you get to the "Do You Already Own a Mac" screen, select "Do not transfer my information" and press Continue. Have your existing Apple ID and password ready - do not create a new one unless that is what you really want to do.
When it completes, log in under that new account. Use System Preferences > Accounts (or Users & Groups) to delete the User accounts that you no longer need.
You must always include its original discs when giving away or selling any Mac that did not ship with Lion or later OS installed when it was built. That would make resetting the user's passwords a trivial matter.