Maybe you are setting up a new machine for your parents and you wanted to have them to go through the setup experience themselves, or maybe (more likely) you have an older machine that still has some usable life and you are looking to clean install the OS, install iLife and the upgrades and then reset it back to the Setup Assistant so its new owner can set it up the way he or she wants to. Whatever your reasons for needing to do it, here is how to reset Mac OS X 10.5 (Leopard) back to the Setup Assistant, just like it was when you first got it.
- Boot your computer to Single User Mode.
- Mount the local filesystem:
mount -uw /
- Load Directory Services:
/bin/launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist &
- Remove the user(s) you created to do your work:
dscl . -delete /Users/<account shortname>
Repeat if you need to remove multiple users.
- Remove the files from your user account
NOTE: This will permanently delete files from your hard drive, make sure you back up your information in case you should need to restore it laterrm -R /Users/<account shortname>
Repeat if you need to remove multiple users.
- Remove the hidden file that indicates to the system that there is no need to run the Setup Assistant:
rm /var/db/.AppleSetupDone
That’s it! If you reboot your machine, you should see the Apple Setup Assistant Load and if you create a new user account, all of your files should have been deleted and only the applications and drivers that you preinstalled will still be available to whatever user is taking ownership of the machine. Happy donating!