OSX Forgotten Password
ever forgotten your password in OSX? here's how to reset it using Single User Mode...

For some reason I'll never know, a friend of mine recently decided to change the password on their MacMini, and then promptly forgot the new password.

Luckily, OSX allows you to boot into the computer using Single User Mode, bypassing any password protection (yes, this is technically a security bug, but locking that down is not within the remit of this post).

There are plenty of websites showing the process with which you can then change the password:

  1. hold command-S when booting
  2. /sbin/fsck -y
  3. /sbin/mount -uw /
  4. /sbin/SystemStarter

The only problem is, this didn't work on the MacMini - it hung at the SystemStarter bit, specifically at the Apache Webserver element (not sure if this is the same on all machines).

As it turns out, this was because the above are the commands for OSX 10.2. If you're running 10.3 or 10.4, you'll want the following:

  1. hold command-S when booting
  2. /sbin/fsck -y
  3. /sbin/mount -uw /
  4. /usr/libexec/register_mach_bootstrap_servers /etc/mach_init.d
  5. cd /var/db/netinfo; netinfod -s local
  6. /sbin/SystemStarter

Notice the extra steps (4 & 5).

Once you've run the above, simply 'passwd [username]' without the brackets or quotes, and you'll be prompted for a password. Once  you've changed it, reboot and all should be well.