I forgot the password to Mac OS X 10.5.8 - Leopard.... How can I reset it?

Once you are in single user mode you will need to do the following: 1) mount the file system as read-write 2) navigate to the /var/db directory 3) remove a special file that tells the computer it's already been set up 4) reboot the machine 5) go through the set up process to create a NEW admin account 6) log into the new admin account and reset the password on the original password via the system preferences

The details: Boot to single user mode, then type the following:

mount -uw /
cd /var/db
rm .AppleSetupDone
reboot

At this point the system will reboot and go through the "out of the box" setup process which will allow you to create a new Admin account. The original account will be intact.

After you've created the new user account, you can go to System Preferences, Accounts (might be Users & Groups, they keep changing the name!), and reset the password on the original account.

Keep in mind that if you do this you will lose all stored passwords on the original account, at least until the original owner is able to give you the old password.

Of course, as the new owner, you might want to just use the new account you create and delete the old one...


This solution worked:

  1. Hold command-S on startup.
  2. Run mount -uw / to modify (-u) the status of the root filesystem (/) to make it writable (-w). fsck -fy is not necessary.
  3. Run launchctl load /System/Library/LaunchDaemons/com.Apple.DirectoryServices.plist in 10.6 or earlier, or launchctl load /System/Library/LaunchDaemons/com.apple.directoryd.plist in 10.7 or later.
  4. Run dscl . -passwd /Users/username password, where username is replaced with the username of the account and password is replaced with the new password.
  5. Run reboot.