Reset Leopard (10.5) Back to the Setup Assistant

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.

  1. Boot your computer to Single User Mode.
  2. Mount the local filesystem:
    mount -uw /
  3. Load Directory Services:
    /bin/launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist &
  4. Remove the user(s) you created to do your work:
    dscl . -delete /Users/<account shortname>

    Repeat if you need to remove multiple users.

  5. 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 later
    rm -R /Users/<account shortname>

    Repeat if you need to remove multiple users.

  6. 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!