2015年5月26日星期二

How to Reset a Lost Admin Password on Mac OS X

Two Methods:Using System Preferences and Using Single-User Mode
If your Apple is running OS X, and you are having trouble accessing the administrator's account, follow these few easy steps that will get you full administrative control.
Method 1 of 2: Using System Preferences










1. Go to the Apple menu in the upper right hand side of the screen and click "Log out username".











2.On the accounts presented in the menu select the admin account and enter the password.If you keep on failing, it will ask for your master password that can be changed at the Security menu in system preferences.


Method 2 of 2: Using Single-User Mode
Forget your password to the only administrator account on your Mac? Unable to install software or even log in because you just can't remember which one of your favorite pets you used for the password? Or do you need to access the Super-User (root) account to make changes not allowed even to Administrators?

No worries! We're going to reset that pesky password without losing any of your data or files - and it only takes about five minutes!











1.Access Single-User mode.
(1)Shutdown your computer. (Turn it right off - do not restart.)
(2)Use your left hand to hold down the 'Apple' or 'Command' key on the keyboard (directly beside the space bar) and the letter 'S' . Hold both of these together and do not let go through the next step.Turn the computer on, ensuring that you are still holding the 'Command' and 'S' keys.
(3)Wait until you see a bunch of white writing scrolling by on a black screen. You can release the keys, and you are now in Single-User mode. The computer is ready to continue when you see localhost:/ root# or something similar as the very last line on the screen.











2 Check the drive for errors. Next we want to check the drive for errors (and fix them if there are any). We do this because of the power of Single-User Mode, we do not want to be making massive changes to the file-system if there are underlying issues which could be made worse. Right after the # on the last line of the screen type fsck -fy and press [Return] when the process is finished (approximately two to three minutes) you will seelocalhost:/ root# (henceforth referred to as the prompt) again.











3 Access the drive so that we can make changes. Before you can reset your password you need to mount the drive; this will allow you to make changes to files. At the prompt type mount -uw / and press [Return].











4 Reset the password.
(1)Type launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist and press [Return].
(2)Type ls /Users and press [Return]. A list of all of the accounts on your computer will be listed along with 'Public'
(3)Type dscl . passwd /Users/username password while replacing username with one of the users displayed in the previous step and replacing password with the new password of your choice. Press [Return]. Ignore error message appearing after entering this command.











5 Restart the computer and try the new password. At the prompt type reboot[Return]. The computer will restart and you will now be able to use your new password.

没有评论:

发表评论