This is was the answer to a MacInTouch reader’s question about how
to install apps, provide s/w updates and then put the Mac back
the way it came out of the box to give the eventual user the ‘new
Mac’ experience.
1. Set up the Mac as you want it (install apps, etc.)
2. Reboot into single-user mode (reboot the machine and hold down the
command +s keys as soon as you hear the startup sound.)
3. You’ll get dumped into the terminal. Wait for the command prompt
to appear and type: mount -uw /
— This mounts the boot volume so you can edit it.
** Be very careful from this point forward.**
4. Type: cd /Users
— Moves into the Users directory
5. Type: rm -rf *
— Deletes all of the User folders (Shared, etc.) in the Users
directory. BE VERY CAREFUL with this command - make sure you’re in
the Users folder. If you’re not positive, type: pwd - the output
should be “/Users”
6. Type: cd /var/db/netinfo
— moves into the directory that contains the account
information
7. Type: rm local.nidb
(I had trouble here. Because that is a directory with files the remove comand did not comply. I then cd local.nidb to get into the directory. Did a ls to list the files. Most of the files are Store.xxx. I did a rm Store.* and then rm the rest of the files by their name.)
– Clears the netinfo database and all of the existing accounts
on the system
8. Type: cd ../
— Moves up one level
9. Type: rm .AppleSetupDone
— Remove the file that tells the OS that setup has already been
run - note the period in front of the filename.
10. Type shutdown -h now
— Shuts down the Mac
That’s it! Now the system will basically be back at its “virgin”
state with no existing user accounts or user files. The OS looks for
the existence of “.AppleSetupDone” and if it doesn’t, it reruns the
entire startup sequence (movie, create user, etc.).