recently, Langren34 shared a tutorial on the use of Single-user mode in MAC devices to reset the password of the user's administrator account, if you have this need, may wish to refer to.
Single user mode can reset the MAC Administrator account password?
If your Mac device's current system is El Capitan, Yosemite, mavericks, mountain lion or lion, you can do this by using the following procedure:
1. Start the MAC device in Single-user mode.
2. Open the Terminal window and enter the following command:
MOUNT-UW/
3. Capitan or Yosemite system users enter the following two commands, respectively:
Launchcti load/system/library/launchdaemons/com.apple.taskgated.plist
Launchctl load/system/library/launchdaemons/com.apple.opendirectoryd.plist
The Mavericks, mountain Lion or Lion system users enter the following command:
Launchctl load/system/library/launchdaemons/com.apple.opendirectoryd.plist
Note that if you don't know the user's short name, you can enter the following command to get the user list (the short name is on the left and the full name is on the right):
DSCL localonly ls/local/default/users Realname
4. Enter the following command and replace ShortName with the short name of the administrator user (name of the user's personal folder):
passwd ShortName
When prompted, enter a new account password, but you may not see any indication that you are typing.
5. Enter the reboot command to restart the Mac.
If your Mac device's current system is snow Leopard, you can reset the password by following these steps:
1. Start the Mac in Single-user mode.
2. Open the Terminal window and enter the following command:
MOUNT-UW/
If you do not know the user's short name, enter the following command to obtain a list of short names:
Ls/users
3. Enter the following command:
Launchctl load/system/library/launchdaemons/com.apple.directoryservices.plist
4. Enter the following command and replace the shortname with the user's short name (name of the user's personal folder):
passwd ShortName
5. When prompted, enter a new account password, again, you may not see any indication that you are typing.
6. Enter the reboot command to restart the Mac.