How To Create An Admin Account In The Mac Terminal

The terminal is a Mac utility that is often overlooked because some users find it arcane. But it provides an opportunity to customize elements of your Mac by using command line prompts. This way, you can perform tasks that would otherwise require additional software.

How To Create An Admin Account In The Mac Terminal

One advantage of using Terminal is that you can quickly create a new admin account, replace an admin, or add new users on your Mac. In this article, we’ll go over all the details regarding how to use Terminal as a Mac administrator, and we’ll answer a few commonly asked questions.

How to Create an Admin Account on a Mac Using Terminal

Creating a new admin account using Mac’s graphical interface is often the fastest option, but there are times when using Terminal is a preferable option.

For example, if you’re troubleshooting an issue remotely via the Screen Sharing feature, you’ll need to open Terminal. Before diving into the steps you’ll need to take to create an administrator account using Terminal, let’s find out where you can find this utility:

  1. Go to the “Finder” app and then select “Applications.”
    How To Create An Admin Account In The Mac Terminal
  2. Scroll down and double-click on the “Utilities” folder.
    How To Create An Admin Account In The Mac Terminal
  3. Find Terminal and open it.
    How To Create An Admin Account In The Mac Terminal

Now, follow these steps to make a new administrator account:

  1. Type in sudo dscl . -create /Users/username and then hit enter. Then change the “username” part with one word of your choosing. Type in a new password and hit “enter” again.
    How To Create An Admin Account In The Mac Terminal
  2. Type in sudo dscl . -create /Users/username UserShell /bin/bash and hit “enter “again.
    How To Create An Admin Account In The Mac Terminal
  3. Now add the following command: sudo dscl . -create /Users/username RealName “Jane Smith” and hit “enter.”
    How To Create An Admin Account In The Mac Terminal
  4. The next step is to type in sudo dscl . -create /Users/username PrimaryGroupID 1000 followed by “enter.”
    How To Create An Admin Account In The Mac Terminal
  5. Continue by typing in sudo dscl . -create /Users/username NFSHomeDirectory /Local/Users/username and hitting “enter.” This prompt creates a new user folder.
    How To Create An Admin Account In The Mac Terminal
  6. To replace the password, type in sudo dscl . -passwd /Users/username password followed by “enter.” Choose a new password you’ll use every time you log in.
  7. To give the user administrative privileges, type in “sudo dscl . -append /Groups/admin GroupMembership username” and hit “enter.”

How To Create An Admin Account In The Mac Terminal

How to Make Yourself an Administrator From the Terminal on Mac

If you’re using a Mac on which you don’t have an administrative role, you can change that by entering specific commands in Terminal.

That will give you permission to change important settings, as well as other privileges such as installing new programs. Here’s how you can change an existing user account to an administrative account via Terminal:

  1. Open the Terminal app following the same steps listed above.
  2. Type in sudo dscl / -append /Groups/admin GroupMembership USERNAME and replace “username” with your name.
  3. Now enter the administrative password.

You will get an administrative function upon executing that command. Keep in mind that you must have the administrative password to make this change in the first place.

How to Change Your Username on Mac

You can easily change your username on macOS, but you need to change the name of the home folder as well for it to work. So, here is how to change the name of the home folder:

  1. Log in to the administrative account on your Mac.
  2. Open the Users folder on the account you want to rename.
  3. Rename the home folder, but make sure there are no spaces in the name. You’ll need to enter the administrator’s name and password.

The next step is renaming the Mac user account:

  1. From the admin account on Mac, follow the path Menu>System Preferences.
    How To Create An Admin Account In The Mac Terminal
  2. Select “Users & Groups” and click on the lock icon. Then enter the admin name and password.
    How To Create An Admin Account In The Mac Terminal
  3. Click on the user you want to rename and select “Advanced Options.”
    How To Create An Admin Account In The Mac Terminal
  4. Enter the same name you used for the home folder.
    How To Create An Admin Account In The Mac Terminal
  5. Go to “Home directory” and change the account name to match the home folder as well.
    How To Create An Admin Account In The Mac Terminal
  6. Select “Ok” and then restart your computer.
    How To Create An Admin Account In The Mac Terminal
  7. Next time you log into the newly renamed account, make sure all the files and folders are visible.

How to Create an Admin Account in a Single User Mode

The first thing you need to do to create an admin account from a Single User Mode is shut down your Mac. Then restart it in a Single User Mode by turning it on while pressing and holding “Command + R.” Then follow these steps:

  1. Enter /sbin/mount -uw / command when prompted and press “enter.”
  2. Next, type in rm /var/db/.applesetupdone and hit “enter.” This will remove the file that tells the OS the setup process has been performed before.
  3. When this file is removed, you need to restart your Mac again.
  4. Next time the Mac reboots, you’ll see a “Welcome to Mac” window on the screen. You can follow the prompts to make a new admin account.

How To Create An Admin Account In The Mac Terminal

Frequently Asked Questions

We’ve included some more information for you in this section.

How Does Terminal Work on Mac?

The terminal is an app found in the Utilities folder inside all Mac devices. It has a Unix command-line system, which some users prefer.u003cbru003eu003cbru003eEvery command you use in Terminal contains three elements. The first is the command itself. The second is the argument that provides the information about the resource on which the command operates. And the third is having the option for modifications of the output.

Can I Have Multiple Administrator Accounts on My Mac?

The answer is yes. Your Mac can have more than one administrator account. You can also change standard or share-only user accounts to administrator accounts.

How Do I Create User Accounts From the Terminal in macOS?

To create a user account from Terminal in Mac, follow steps 1-6 in this article under u0022How to Create an Admin Account on a Mac Using Terminal.” All you need to do is skip the final step, and you’ll have the standard user account.

Managing Your Mac Admin Accounts

The macOS graphic interface allows users to create new admin accounts and add and remove admin privileges as well. But in some instances, accessing this feature via the Terminal app is faster and simpler.

It’s also a great way to get acquainted with the basics of how macOS works. Follow the steps we’ve provided to add new admin accounts via Terminal.

Have you used Terminal on Mac before? What was the main reason? Let us know in the comments section below.

Sign up and earn $1000 a day ⋙

How to fix error 0xa00f4288 in Camera app on Windows 10 & 11

How to fix error 0xa00f4288 in Camera app on Windows 10 & 11

How to fix error 0xa00f4288 in the Camera app on Windows 10 & 11. Windows' default Camera App is the main tool for taking photos. So in the case of Win 10 & 11 cameras

How to open multiple programs with one shortcut on Windows 10

How to open multiple programs with one shortcut on Windows 10

How to open multiple programs with one shortcut on Windows 10, You can actually open multiple programs at the same time with a single key. Here's how to use one

How to delete old boot menu options on Windows

How to delete old boot menu options on Windows

How to remove old boot menu options on Windows, Windows 10 dual boot is useful but can leave redundant boot options in the menu. Here's how to remove the menu

Instructions for fixing Snipping Tool errors on Windows 11

Instructions for fixing Snipping Tool errors on Windows 11

Instructions for fixing Snipping Tool errors on Windows 11. Windows 11 has officially been released for a while, but during use there are still many errors

Instructions for entering text by voice on Windows 11

Instructions for entering text by voice on Windows 11

Instructions for entering text by voice on Windows 11, Entering text by voice on Windows 11 helps you significantly improve your work efficiency. Here's how

How to turn on/off Sticky Key on Windows 11

How to turn on/off Sticky Key on Windows 11

How to turn on/off Sticky Key on Windows 11, Sticky Key makes the PC keyboard easier to use. Here's how to turn Sticky Key on and off on Windows 11.

What is Windows Modules Installer?

What is Windows Modules Installer?

What is Windows Modules Installer?, Windows Modules Installer sometimes takes up a lot of system resources. Is Windows Modules Installer important or not?

How to increase volume in Windows 10

How to increase volume in Windows 10

How to increase volume in Windows 10, How to increase computer volume to maximum level? Let's learn with WebTech360 how to increase Windows 10 computer volume

How to use Windows 11 Installation Assistant to install Windows 11

How to use Windows 11 Installation Assistant to install Windows 11

How to use Windows 11 Installation Assistant to install Windows 11, Windows 11 Installation Assistant is one of the best ways to upgrade your computer to Windows 11.

How to turn off the startup sound in Windows 11

How to turn off the startup sound in Windows 11

How to turn off the startup sound in Windows 11, Does the PC startup sound bother you? Then please refer to how to turn off the startup sound for PC running Windows 11 below

Instructions for changing the screen lock timeout on Windows 11

Instructions for changing the screen lock timeout on Windows 11

Instructions for changing the screen lock timeout on Windows 11. While using Windows 11, there are times when users will need to leave the computer for a period of time.

Windows 11 optimization guide to increase FPS when playing games

Windows 11 optimization guide to increase FPS when playing games

Instructions for optimizing Windows 11 to help increase FPS when playing games, Windows 11 is an operating system platform that is introduced as more improved in gaming quality, helping games

Windows 11: How to use and customize the Quick Settings menu

Windows 11: How to use and customize the Quick Settings menu

Windows 11: How to use and customize the Quick Settings menu, Windows 11 brings some great new features and the Quick Settings menu is no exception. Here it is

How to fix the error of not being able to start Windows 11 after enabling Hyper-V

How to fix the error of not being able to start Windows 11 after enabling Hyper-V

How to fix the error of not being able to start Windows 11 after turning on Hyper-V. Hyper-V helps you run virtual machines on Windows. However, after enabling Hyper-V, you cannot post again

How to fix error 0xc00007b in Windows

How to fix error 0xc00007b in Windows

How to fix error 0xc00007b in Windows, Windows displays error 0xc00007b when the application does not work properly. Below is a step-by-step guide to fix error 0xc00007b in

How to change the login screen on Windows 10/11

How to change the login screen on Windows 10/11

How to change the login screen on Windows 10/11, Don't like the blurry screen when logging in on Windows 10/11? So, instructions on how to turn off and change the login screen

How to uninstall drivers in Windows 11

How to uninstall drivers in Windows 11

How to uninstall drivers in Windows 11, Do you want to remove unwanted drivers on Windows 11? Then please see instructions on how to remove drivers in Windows

How to fix No Internet Secured error on Windows 10

How to fix No Internet Secured error on Windows 10

How to fix No Internet Secured error on Windows 10, No Internet Secured is a common error on Windows 10. Below are simple ways to fix No Internet Secured error

How to fix the error of not being able to save Excel files on Windows

How to fix the error of not being able to save Excel files on Windows

How to fix the error of not being able to save an Excel file on Windows. If you can't save the Excel file, don't worry too much. Below are ways to fix the error of not being able to save the above Excel file

How to open DMG files on Windows

How to open DMG files on Windows

How to open DMG files on Windows, DMG is a file format specific to the macOS operating system. However, you still have a way to open DMG files on Windows.