X

How to change passwords in OS X

Every now and then an account password in OS X may need to be changed so folks can access the account. Here are ways to go about doing this.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
3 min read

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.

Accounts Change Password Button
After authenticating, click this button to change the account's password.

In most cases this resource is all that's needed, and resetting a password is as simple as following this procedure:

  1. Go to the Accounts system preferences.
  2. Click the lock at the bottom of the window and provide an administrative account username and password.
  3. Select the desired account.
  4. 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.

Installation DVD
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:

  1. Insert the installation DVD and restart the system with the C key held down.
  2. Select your language in the installer, and then select Reset Password from the Utilities menu.
  3. Select the Admin account and then reset the password.
  4. 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:

  1. Reboot the system and hold the Command and S keys down during start-up.
  2. When the command prompt shows, enter one of the following command options (either will work):

    Command 1:

    passwd USERNAME

    Command 2:

    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:

    ls /Users

  3. When a new password has been set for the account, restart the system by entering "reboot" at the command prompt.

Cautionary notes
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).



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.