方法1: By Access Single-User mode.
Use your left hand to hold down the 'Command' + 'S'
localhost:/ root#
/sbin/fsck -fy
/sbin/mount -rw /
# Skip this step if you’re running 10.6 Snow Leopard or earlier.
launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
# A list of all of the accounts on your computer
ls /Users
# Reset the password
dscl . passwd /Users/<username> <new-pw>
# reboot
reboot
方法2: Boot into Recovery Partition
down the ‘command’ + ‘r’ keys on the keyboard
Go to the Utilites menu and select Terminal
At the prompt type ‘resetpassword’