Here is Apple's advice what to do before selling or giving away a Mac:
I bought a new iMac and gave the old iMac (2010) to the wife. After transferring my stuff to the new iMac, I erased the old iMac, intending to do a clean install of Mavericks using the wife's Apple ID. But when I try to do so, the installer says that her ID hasn't been used to download Mavericks. It seems the only ID that will install Mavericks on that iMac is mine.
Is there some trick to wiping a Mac before giving the machine to another person? Are they going to have my ID permanently associated with Mavericks on that iMac? And are they going to need my ID to download system updates? Yikes! Glad that person is my wife. Still, I'd like to give her a clean system associated with her ID. How can I do that?