JTechDev

Reset your mac's password without losing any data

In this tutorial, I will show you how to reset your mac’s password without losing your account or anything. This is extremely useful if you have forgotten your master password and do not have a root account. Though there are probably other methods out there, this is the best one I have seen.

So, to start out, shut down your mac and make sure it has sufficient power to last, because you do not want your mac to shut down in the middle of the process. Then, press the power button and hold cmd + s. This will boot you into root mode as shown below.

Mac-Reset-Password-ScreenShot#1It should end up with “:/ root#” and you can enter commands. The reason you needed to restart your computer into this mode is to give you root excess.

Now that you have started into root, type the following command and click enter:

/sbin/mount -uaw

Also type this command and press enter:

rm /var/db/.applesetupdone

This will remove the file that tells the system that you have set up the computer. Please be extremely careful using the rm command. This command, if not used properly, could delete every file on the system.

Now that you have run these commands reboot the computer by typing this command and clicking enter:

reboot

Once your computer boots, it will display the intro video. I have not found a way to skip it, so you probably have to go through the whole thing. The video will end on a large X as shown below:

Mac-Reset-Password-ScreenShot#2

After that, you will see a screen like the one pictured:

Mac-Reset-Password-ScreenShot#3.JPG

Select your language and click enter. This wizard will guide you through most of the process. When you come to the login options panel, do not use the name of your original account, but something like “tmp”. After the first panel, you should see something like what is imaged below.

Mac-Reset-Password-ScreenShot#4

Make sure when this comes up, click “Do not transfer my information now”, because this will keep all your settings the way they are. You should continue and see the following:

Mac-Reset-Password-ScreenShot#5

This panel you can skip. The next couple of panel is pretty self explanatory as shown below:

Mac-Reset-Password-ScreenShot#6

Mac-Reset-Password-ScreenShot#7

Create your new admin account and make sure you create an easy password so you don’t lock yourself out. ;)

Once you have finished with the wizard, you will be logged into your new account. Go to “System Prefrences->Accounts” and click the lock to edit the passwords.

Mac-Reset-Password-ScreenShot#8Mac-Reset-Password-ScreenShot#9

Then, go to your old account and click “Reset Password” and enter your new password.

Mac-Reset-Password-ScreenShot#10

Log out of the temporary account and log into your old account with the password you just set. Once you log in, you may want to delete the temporary account. To do this, go to “System Prefrences->Accounts” again. Click the lock to allow you administrative access. Once you have entered the password, select the temp account and click on the minus button right above the lock. You will get a confirmation dialog like the one below:

Mac-Reset-Password-ScreenShot#11

Make sure to select “Delete the home folder” so that you don’t have the old users home information. After you have done that, everything is set back to normal except for one thing. The last thing you have to do is set the computer’s name back to what it was. To do this go to “Preferences->Sharing” and click the lock again. Once you have unlocked this preference pane, just edit the name of the computer shown at the top of the window.

Mac-Reset-Password-ScreenShot#12

And that is it! You have given yourself full permissions over the computer again. The one thing this does not do, is unlock keychain excess. This is because keychain excess encrypts the data based on your password. When you change the password, the keychain password is still your old one. I have no idea how you could recover that, but apple probably made sure that it is very hard.