Create Admin User Mac Terminal
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.
Convert Standard User Account to Administrator Account from Command Line of Mac OS. While most Mac users would be best served by converting account status to admin through the Users & Groups preference panel, advanced users can perform the same function through the Terminal by using the Directory Service command line utility dscl.
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.
To boot to Single User mode, start your Mac while holding down the command + S keys.
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.
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:
/sbin/mount -uw /
Press enter or return on your keyboard.
Your startup drive is now mounted; you can access its files and folders from the command prompt.
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.
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:
rm /var/db/.applesetupdone
Press enter or return.
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:
Reboot
Press enter or return.
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.
If your Mac has multiple users, you should set up an account for each person so each can personalize settings and options without affecting the others. You can let occasional users log in as guests without access to other users’ files or settings. You can also create groups. You must be an administrator of your Mac to perform these tasks.
Add a user
Choose Apple menu > System Preferences, then click Users & Groups.
Click the lock icon to unlock it, then enter an administrator name and password.
Click the Add button below the list of users.
Click the New Account pop-up menu, then choose a type of user.
Administrator: An administrator can add and manage other users, install apps, and change settings. The new user you create when you first set up your Mac is an administrator. Your Mac can have multiple administrators. You can create new ones, and convert standard users to administrators. Don’t set up automatic login for an administrator. If you do, someone could simply restart your Mac and gain access with administrator privileges. To keep your Mac secure, don’t share administrator names and passwords.
Standard: Standard users are set up by an administrator. Standard users can install apps and change their own settings, but can’t add other users or change other users’ settings.
Managed with Parental Controls: Users who are managed with parental controls can access only the apps and content specified by the administrator managing the user. The administrator can restrict the user’s contacts and website access, and place time limits on computer use.
Sharing Only: Sharing-only users can access shared files remotely, but can’t log in to or change settings on the computer. To give the user permission to access your shared files or screen, you may need to change settings in the File Sharing, Screen Sharing, or Remote Management panes of Sharing preferences. For more information, see Use File Sharing to share files and Screen sharing overview.
For more information about the options for each type of user, click the Help button in the lower-left corner of the dialog.
Enter a full name for the new user. An account name is generated automatically. To use a different account name, enter it now—you can’t change it later.
Enter a password for the user, then enter it again to verify. Enter a password hint to help the user remember their password.
Click Create User.
Depending on the type of user you create, you can also do any of the following:
For an administrator, select “Allow user to administer this computer.”
For a child or other managed user, select “Enable parental controls.” Click Open Parental Controls, then set up restrictions for the user. For more information, see Set up parental controls.
Use Sharing preferences to specify whether the user can share your files and share your screen.
If your Mac has Touch ID, a new user can add a fingerprint after logging in to the Mac. The user can then use Touch ID to unlock the Mac and password-protected items, and purchase items from the iTunes Store, App Store, and iBooks Store using their Apple ID. For more information, see Use Touch ID on your Mac.
Create a group
A group allows multiple users to have the same access privileges. For example, you can grant a group specific access privileges for a folder or a file, and all members of the group have access. You can also assign a group specific access privileges for each of your shared folders.
Choose Apple menu > System Preferences, then click Users & Groups.
Click the lock icon to unlock it, then enter an administrator name and password.
Click the Add button below the list of users.
Click the New Account pop-up menu, then choose Group.
Give the group a name, then click Create Group.
Select each user and group you want to add to the new group.
Use Sharing preferences to specify whether the group members can share your files and share your screen.
Convert a standard or managed user to an administrator
Choose Apple menu > System Preferences, then click Users & Groups.
Click the lock icon to unlock it, then enter an administrator name and password.
Select a standard user or managed user in the list of users, then select “Allow user to administer this computer.”
Let occasional users log in as guests
No Admin User On Mac
You can let other people use your Mac temporarily as guest users without adding them as individual users. You can use parental controls to set restrictions so guests can access only items that you want to share.
Create Admin User Mac Terminal Map
Guests don’t need a password to log in.
Guests can’t change user or computer settings.
Guests can’t log in remotely when remote login is turned on in Sharing preferences.
Files created by a guest are stored in a temporary folder, but that folder and its contents are deleted when the guest logs out.
Guest access works with the Find My Mac feature of iCloud to help you find your Mac if you lose it. You can locate your Mac if someone finds it, logs in as a guest, and then uses Safari to access the Internet. See Use Find My Mac.
Note: If FileVault is turned on, guests can only use Safari and can’t access your encrypted disk or create files.
Choose Apple menu > System Preferences, then click Users & Groups.
Click the lock icon to unlock it, then enter an administrator name and password.
Select Guest User in the list of users.
Select “Allow guests to log in to this computer.”
If you like, select “Enable parental controls,” then click Open Parental Controls. For more information, see Set up parental controls.
To let guests use your shared folders from another computer on the network, select “Allow guest users to connect to shared folders.”
Customize the login experience
If you are an administrator, you can specify how the login window looks to all the other users.
Choose Apple menu > System Preferences, click Users & Groups, then click Login Options.
Click the lock icon to unlock it, then enter an administrator name and password.
Click the “Automatic login” pop-up menu, then choose a user, or choose Off.
If you choose a user, then whenever the Mac starts up, that user is automatically logged in. If you choose Off, then at startup the Mac opens a login window showing all the users. Automatic login takes effect the next time you restart the Mac.
Note: Automatic login allows anyone to access your Mac simply by restarting it. If automatic login is enabled, make sure your Mac doesn’t automatically log in an administrator. When FileVault is turned on, automatic login is disabled.
Select the options you want. If you have any questions, click the Help button for detailed information.
To permit new users to access your shared files or screen, you may need to change settings in the File Sharing, Screen Sharing, or Remote Management pane of Sharing preferences. For more information, see Use File Sharing to share files and Screen sharing overview.
Choose Apple menu > System Preferences, then click Sharing.