There are times when you wish or need to change the password for your account, or for another account on an OS X system. This can be because an account's password has been compromised, or because a Mac has accounts on it for which nobody knows or remembers the password, for example.
There is no way to recover lost passwords, but there are several ways to change them.
Accounts system preferences
Basic account management in OS X is fairly straightforward and easy since Apple offers an Accounts system preference pane where you can add and remove accounts in addition to modifying aspects of them such as the full name, log-in options, and account passwords.
In most cases this resource is all that's needed, and resetting a password is as simple as following this procedure:
- Go to the Accounts system preferences.
- Click the lock at the bottom of the window and provide an administrative account username and password.
- Select the desired account.
- Click the Change Password button next to the account icon.
This option requires that you have an active and working administrative account if you want to change the passwords on other accounts in the system besides your current one.
If you have forgotten the administrator password on your system and have no other administrative access, you can use the OS X installation DVD to reset the password. To do this, follow this procedure:
- Insert the installation DVD and restart the system with the C key held down.
- Select your language in the installer, and then select Reset Password from the Utilities menu.
- Select the Admin account and then reset the password.
- Restart the computer.
This method can be used to reset the password on any account in the system so you can log in to that account from the log-in window.
No installation DVD
While the first two methods for resetting a password are the preferred ones, there are times when you may not have an installation DVD and don't have administrative access to the system to reset an account's password. In these cases, the following procedure should work:
- Reboot the system and hold the Command and S keys down during start-up.
- When the command prompt shows, enter one of the following command options (either will work):
dscl . -passwd /Users/USERNAME
In these commands, USERNAME is the short name of the account. This is usually the name of the user's home folder, so at this same command prompt you can list the home folders on the system by running the following command:
- When a new password has been set for the account, restart the system by entering "reboot" at the command prompt.
While resetting the password can be convenient in some cases, there are instances where it may cause problems. The first is that changing the password manually will break the link to the user's log-in keychain. This means that the log-in keychain will no longer automatically unlock when the user logs in, though the way to fix this is to delete the keychain using the Keychain Access utility and then log out and back in so it can be recreated.
The second caution is for people who are trying to enable existing accounts on a used Mac that was not formatted by the previous owner. We always recommend in these cases that you forgo any password or account recovery and format the system using an OS X installation DVD. Sometimes it can be very difficult to determine if the system's security has been compromised by any software running on it or changes to the OS. A fresh OS installation will clear these potential problems.
The gray OS installation and recovery DVDs that came with the system should be given to the new owners of the computer, but if you do not have any OS installation DVDs you can purchase one from an Apple store (they are always a good idea to have).