1st Nov 2015 Return to First Boot
I repair people’s Macs for a living. Often the task requires reinstalling the operating system, and installing updates. Before I return a computer to its owner I always remove the temporary user account I created, and reset the machine back to the Setup Assistant. By following these commands, the owner has the chance to connect to wifi, create a new user account, and sign into iCloud the next time they turn on their computer.
- Boot into Single-User Mode by pressing
⌘-Sat startup. - Once the command-line prompt appears type the following commands.
mount -uwrm -R /Library/Preferences/rm -R /Users/usernamecd /var/db/dslocal/nodes/Defaultusers- Type
lsto list the contents of the directory. - Delete the active user account, by typing
rm username.plistwhere username is the name of the active account. rm /var/db/.AppleSetupDonereboot- Mac OS X will restart, and the Setup Assistant will launch automatically.
If you are preparing the Mac for a new owner, press ⌘-Q and click Shutdown. The Setup Assistant run again the next time the Mac is restarted.
For Macs running Mac OS X 10.4 Tiger and earlier, follow these steps.
- Boot into Single-User Mode by pressing
⌘-Sat startup. - Once the command-line prompt appears type the following commands.
mount -uwrm -R /Library/Preferences/rm -R /Users/usernamerm /var/db/netinfolocal.dbrm /var/db/.AppleSetupDonereboot- Mac OS X will restart, and the Setup Assistant will launch automatically.