Resetting the root password in Mac OS X 10.3

Say you’ve misplaced the System Install CD for your Mac, and it was released after the box set of Panther you have was made. But you’ve lost the root password to your Mac. What to do?

<p>Any unix geek will tell you to boot into single user mode and reset the root password.  But it’s not quite so easy under Mac OS X because of the NetInfo database, where the root password is stored.  And the NetInfo server depends on other servers, which depend on…  it can be trying to have everything up and running required to just reset the password.</p>
<p>Well, a few simple steps will get everything running that’s required to change the root password.  This is very lightly documented and there’s plenty of <b>wrong</b> advice on the Internet about how to do this (supposedly).  I’ve actually tested this on a such a machine, a newer iBook that had its passwords changed by a former employee.</p>
<p>First, boot into single user mode.  You should know how to do that, or at least go look it up in the Apple Knowledgebase.  I’ll leave that as an exercise for the reader so as not to overtly aid cretins who are stealing iBooks.  You do have FileVault turned on for you important data, right?</p>
<p>OK, then, type these commands (commands separated by line breaks - watch for text wrap):<br />

/usr/libexec/register_mach_bootstrap_servers /etc/mach_init.d

<p>cd /var/db/netinfo</p>
<p>/usr/sbin/netinfod -s local</p>
<p>/sbin/SystemStarter</code></p>
<p>and everything will be running.  Technically, SystemStarter is cheating since it starts more than you need, but, hey, it works.  So, then, you can now change your root password and reboot:</p>
<p><code>passwd root<br />

reboot

<p>And remember, boys and girls, any machine you have physical access to you own.