Force setup on Leopard on reboot

Suppose you are eager while setting up your Mac OS X Leopard on booting your brand new apple computer for the first time. Chances are that you forget to adjust the ’shortname’ during setup. The ’shortname’ is the actual Unix username that is created for your primary account. By default the Leopard setup program concatenates your first and last name. In my case it created the user ‘eddieniese’ where I really would like to have the user ‘eddie’.


Being a Unix hacker I thought: let’s adjust this by hand. So I inspected to usual suspects to adjust my user account. However you’ll will quickly find that the user is not stored in /etc/passwd. It’s actually stored in some directory server. Okay. Things are different than I’m used to. A little googling did not provide me any info. I could not find any information on changing the primary username (shortname). It turns out that you can not change the primary user account created on setup using the Mac OS X interface. Just my luck. I tried to create another user account similar to the primary user and try to remove the primary user. You can’t do that. Mac OS X doesn’t allow you to throw away the primary user.

Where to go from here? Sure you can reinstall the entire OS but that takes just too much time. I just need another shot at the setup. I tried googling for tips on how to force Mac OS X to run the setup on startup again. So I wanted to trick Mac OSX to do another setup as if I booted my machine for the first time. I did find several sources that had contradicting information on how to do that. Some only worked on older Mac OS X releases but not on Leopard. But after combining information from several sources I found a recipe that is very simple and worked for me. Please use this with care since a complete setup is performed. You will loose about everything you have so far. Make a backup of relevant stuff before trying this. This worked for me using Leopard on a MacBookPro. I accept no responsibility nor liability. Use at your own risk.

  • Restart your Mac. Press <apple> + S during boot to enter single user mode
  • mount -uw /
  • rm -R /Library/Preferences
  • rm -R /Users/<primary username> (”eddieniese” in my case)
  • /bin/launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist &
  • dscl . -delete /Users/<primary username> (”eddieniese” in my case)
  • rm /var/db/.AppleSetupDone
  • exit

After typing ‘exit’ your system will reboot and will start the setup utility again and allows you to create another primary user.

3 Responses to “Force setup on Leopard on reboot”

  1. Sander Says:

    Wow, that sounds so user friendly! Those things don’t only look good, they are obviously a breeze to use!

  2. fd0 Says:

    Any luck with Macports on Leopard? Seems like this is still not ported (properly) to Leopard I hear. I am staying with Tiger for a while until I get confirmation from friends who have no problems with Leopard…

    Still.. A great machine :-)

  3. Eddie Says:

    Well I do have a problem with some of the macports stuff. I tried gimp and wireshark and both crash with some vague X11 error. When I have some time on my hands I will look into this.

Leave a Reply