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

Use Single User mode to create a new admin account for troubleshooting

Creating a spare admin user account can be beneficial when 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."

These instructions apply to modern macOS and OS X systems.

Why a Spare Admin User Account Is Helpful

A spare admin user account hasn't had changes made to its preference files. It also doesn't contain any data beyond what macOS adds when the account is created. After 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.

You may be locked out of your Mac 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.

How to Create an Admin Account in Single User Mode

To create a spare admin account, first turn off your Mac. If you're not able to shut it down normally, press and hold the Power button.

Once the Mac shuts down, restart it in a special startup environment called Single User mode. This mode boots the Mac into a Terminal-like interface where you can run commands from a prompt.

Person creating a new admin account on a Mac
Lifewire / Theresa Chiechi
  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 / and 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 and it guided you through 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 and 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 and 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 use Single User mode for many different troubleshooting processes, including repairing a startup drive that won't start up.

Was this page helpful?