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

When you can't log in to a Mac, try creating a new admin account

Creating a spare admin user account can be beneficial in situations where you're locked out of your Mac—perhaps because it is frozen, and you already tried resetting the PRAM or the SMC. In such cases, you may see a message that says, "Unable to log in to the user account at this time."

A spare admin user account is useful because it hasn't had changes to its preference files. It also doesn't contain any data beyond what macOS adds when the account is created. Once you have administrative access to your Mac, you can reset your forgotten password and then log out and log back in with your regular account.

These instructions apply to modern macOS (or Mac OS X) systems.

Person creating a new admin account on a Mac
Lifewire / Theresa Chiechi

You may be locked out of your Mac either because you forgot your user account password or the Mac is acting up. In these cases, force the Mac to create a new administrator account with a new user ID and password.

This method of gaining access to a Mac has a couple of drawbacks. It won't work if you encrypted the Mac's drive using FileVault, or if you set up a firmware password for which you forgot the password.

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

How to Create an Admin Account in Single User Mode

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

Once the Mac shuts down, restart it in a special startup environment called Single User mode. This mode boots a Mac into a Terminal-like interface where you can run commands 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, press and hold Command+R while you start the Mac.

  2. The Mac displays scrolling lines of text as it boots up. Once the scrolling stops, you'll see the following command line prompt:

    :/ root#

  3. At this point, the Mac is running, but the startup drive isn't mounted. Mount the startup drive to access the files located on it. At the command prompt, enter /sbin/mount -uw /, then press Enter or Return on the keyboard.

  4. With the startup drive mounted, you can access its files and folders from the command prompt.

  5. Force macOS to think that when you restart your Mac, it's the first time you've booted into the currently installed version of macOS. This makes the 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 doesn't remove or alter your existing system or user data. It allows you to create one new admin user account.

    To restart the Mac in this special mode, remove the file that tells the OS whether the one-time setup process has been performed. At the command prompt, enter rm /var/db/.applesetupdone, then press Enter or Return.

  6. With the applesetupdone file removed, the next time you restart the Mac, you are guided through the process of creating the necessary admin account. At the prompt, enter reboot, then press Enter or Return.

  7. The Mac restarts and displays the Welcome to Mac screen. Follow the step-by-step guide to create a new admin user account. Once you finish creating the account, the Mac logs you in with the new account. You can then proceed with whatever troubleshooting steps you need to perform.

    Create a Computer Account screen in macOS

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