How to reset iMac to factory defaults? I want to sell my iMac (2011) and I want to reset the system and remove all my data. I tried the Command-R method. It wants me to enter my Apple ID and password but I don't want to do this! I want to pre-install the fresh OS X and let the new user finish the set up as he would after buying a new iMac (enter/create his own Apple id, time zone, etc.).  

Any ideas how I can do this?
Based on this answer and personal experience with a Yosemite iMac I recommend


Hold ⌘+R during boot to boot to recovery console.
Use Disk tool to erase main partition.
Exit disk tool, launch system reinstallation instead.


I was very surprised that skipping step 2 I ended up with a fresh install which nevertheless contained the account I had on the machine before. Not factory default.

The disk erase step allows choosing the tradeoff between speed and security. So if you have personal data on the machine, better do a slow but thorough erase there.