10.9: Update OS without creating a user on a new Mac
Jul 14, '14 07:00:00AM • Contributed by: SideStepSociety

Jul 14, '14 07:00:00AM • Contributed by: SideStepSociety
This is my take/an update on las_vegas' hint I found here awhile back for running OS updates without creating a user on a Mac. It is applicable to any system 10.5 and up.
This can be helpful if you have a Time Machine backup that's on a newer OS than your install media, or if you're selling/donating your Mac as it saves the new user having to update things.
First things first, wipe your drive (and zero it if you don't trust the end user of this computer) and reinstall your desired OS.
Once your OS is installed, boot to your install media or the Recovery Partition if available. Open Terminal from the Utilities option in the menubar. In the new Terminal window, type the following:
This will bring up the Password Reset utility. Click Macintosh HD or whatever your HDD is called. You'll notice the only user account that's available is root. Enter a password you'd like to use/remember, though it doesn't really matter as we'll be disabling root and removing this password later. Click save, close the password reset utility and go back to working in Terminal. Now you'll want to enter the following command:
This will create the file on Macintosh HD that tells the computer it has completed the setup so you're able to skip the process and login with the root account we just enabled.
Close Terminal and reboot the computer into the Macintosh HD. You should be greeted by the login screen with an option that says Other. Click Other, enter root as the username and the password you chose to login.
Proceed with Software Updates and any optional software you'd like to install, making sure to install for All Users if prompted. Also keep in mind that any preference changes you make will only apply to the root user, so there's no sense in wasting any time customizing the look, feel and general operation of the computer.
After all software is installed, open up Terminal once more. Enter the following code:
This will remove the file we originally created and re-enable the setup assistant to help create the new/first user on the Mac.
Next, open up Directory Utility. This can be found in Users & Groups in System Preferences. Click Login Options, then click Join... by Network Account Server. You should then see the option Open Directory Utility.
Once in Directory Utility, click Edit in the menubar and then select Disable root user. As a note, this can be done while logged in as root. Close Directory Utility and restart the computer, booting back into to your install media or Recovery Partition. Open up Terminal one last time and enter:
Once the Password Reset utility has appeared, click the root user once more. Instead of changing the password, however, simply click the Reset button to reset Home Folder ACLs.
Reboot your Mac, confirm you see the Setup Assistant and you're ready to move onto restoring your backup or selling your computer!
[crarko adds: I haven't tested this one.]
This can be helpful if you have a Time Machine backup that's on a newer OS than your install media, or if you're selling/donating your Mac as it saves the new user having to update things.
First things first, wipe your drive (and zero it if you don't trust the end user of this computer) and reinstall your desired OS.
Once your OS is installed, boot to your install media or the Recovery Partition if available. Open Terminal from the Utilities option in the menubar. In the new Terminal window, type the following:
resetpassword
This will bring up the Password Reset utility. Click Macintosh HD or whatever your HDD is called. You'll notice the only user account that's available is root. Enter a password you'd like to use/remember, though it doesn't really matter as we'll be disabling root and removing this password later. Click save, close the password reset utility and go back to working in Terminal. Now you'll want to enter the following command:
touch /Volumes/Macintosh\ HD/private/var/db/.AppleSetupDone
Close Terminal and reboot the computer into the Macintosh HD. You should be greeted by the login screen with an option that says Other. Click Other, enter root as the username and the password you chose to login.
Proceed with Software Updates and any optional software you'd like to install, making sure to install for All Users if prompted. Also keep in mind that any preference changes you make will only apply to the root user, so there's no sense in wasting any time customizing the look, feel and general operation of the computer.
After all software is installed, open up Terminal once more. Enter the following code:
rm /private/var/db/.AppleSetupDone
This will remove the file we originally created and re-enable the setup assistant to help create the new/first user on the Mac.
Next, open up Directory Utility. This can be found in Users & Groups in System Preferences. Click Login Options, then click Join... by Network Account Server. You should then see the option Open Directory Utility.
Once in Directory Utility, click Edit in the menubar and then select Disable root user. As a note, this can be done while logged in as root. Close Directory Utility and restart the computer, booting back into to your install media or Recovery Partition. Open up Terminal one last time and enter:
resetpassword
Once the Password Reset utility has appeared, click the root user once more. Instead of changing the password, however, simply click the Reset button to reset Home Folder ACLs.
Reboot your Mac, confirm you see the Setup Assistant and you're ready to move onto restoring your backup or selling your computer!
[crarko adds: I haven't tested this one.]