Can't Log In to Your Mac? Create a New Admin Account

Can't Access Any of Your User Accounts? You Can Still Create a New Admin Account

OS X Yosemite login screen.
If you can't log in to your regular user account, you can still create another admin account by performing the following steps. Screen shot courtesy of Coyote Moon, Inc.

One troubleshooting tip I always recommend is to create a spare admin user account on your Mac. Its purpose is to provide you with an admin user account that is pristine. This account hasn’t had any changes to its preference files and doesn’t contain any data beyond what OS X adds when the account is created.

A spare admin account can be very helpful when you’re having trouble with your Mac. For example, when you try to log into your Mac and it repeatedly freezes up, and you’ve already tried resetting the PRAM or the SMC.

Or, even worse, you can’t log in at all; instead, you see a message that says "unable to log in to the user account at this time."

Unfortunately, even though creating a spare admin account is easy, many of us procrastinate until it’s too late.

Actually, it’s never too late. If for some reason you find yourself locked out of your Mac, either because you have forgotten your user account password or your Mac is acting up on you, it is still possible to force your Mac to create a brand new administrator account with a new user ID and password letting you hopefully regain access to your Mac.

Once you have administrative access to your Mac, you can reset your old forgotten password and then log out and log back in with your regular account.

This method of gaining access to your Mac has a few drawbacks. It won’t work if you have encrypted your Mac’s drive using FileVault, or set up a firmware passwords that you have forgotten the password to.

If you're ready, you can still create another admin account by performing the following steps.

Creating an Admin Account in Single User Mode

Start by turning off your Mac. If you're not able to shut down normally, press and hold the power switch.

Once your Mac shuts down, you’re going to restart it in a special startup environment called Single User mode, which boots your Mac into a Terminal-like interface where you can run commands directly from a prompt.

You can use Single User mode for many different troubleshooting processes, including repairing a startup drive that won't start up.

  1. To boot to Single User mode, start your Mac while holding down the command + S keys.

  2. Your Mac will display scrolling lines of text as it boots up. Once the scrolling stops, you’ll see a command prompt in the form of a ":/ root#" (without the quotation marks). The ":/ root#" is the command line prompt.

  3. At this point, your Mac is running, but the startup drive hasn’t mounted. You need to mount the startup drive, so you can access the files that are located on it. To do this, at the prompt, type or copy/paste the following text:

  4. /sbin/mount -uw /

  5. Press enter or return on your keyboard.

  6. Your startup drive is now mounted; you can access its files and folders from the command prompt.

  7. We’re going to force OS X to think that when you restart your Mac, it’s the very first time you’ve booted into the currently installed version of OS X. This will make your Mac behave the way it did the first time you turned it on, when it guided you through the process of creating an administrator user account.

    This process will not remove or alter any of your existing system or user data; it will just allow you to create one new admin user account.

  1. To restart your Mac in this special mode, we need to remove one file that tells the OS whether the one-time setup process has already been performed. Type or copy/paste the following text at the prompt:

  2. rm /var/db/.applesetupdone

  3. Press enter or return.

  4. With the applesetupdone file removed, the next time you restart your Mac, you will be guided through the process of creating the necessary admin account. Enter the following at the prompt:

  5. Reboot

  6. Press enter or return.

  7. Your Mac will restart and display the Welcome to Mac screen. Follow the step-by-step guide to create your new admin user account. Once you finish creating the account, your Mac will log you in with the new account. You can then proceed with whatever troubleshooting steps you need to perform.

    You can find additional tips that may help with whatever problems you’re having in the Mac Troubleshooting Tips category.

    Published: 4/9/2013

    Updated: 2/3/2015