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 ⋙

Driver Booster 12 Free: Keep 9.5M+ Drivers Up-to-Date in 1-Click

Driver Booster 12 Free: Keep 9.5M+ Drivers Up-to-Date in 1-Click

Driver Booster 12 Free is an effective tool that will keep your computers drivers up to date, which will make the system run faster and more reliably. This driver updater from IObit keeps your PC running at its best by checking for lost, out-of-date, or broken drivers immediately.

Advanced SystemCare 17 Free Review 2024 - Your Best PC Optimizer

Advanced SystemCare 17 Free Review 2024 - Your Best PC Optimizer

In an era where digital efficiency is paramount, Advanced SystemCare 17 Free emerges as a beacon for those seeking to enhance their PC's performance.

Summary of Movies & TV application shortcuts on Windows 10

Summary of Movies & TV application shortcuts on Windows 10

Summary of Movies & TV application shortcuts on Windows 10, Summary of Movies & TV application shortcuts on Windows 10 to bring you a great experience. Maybe

How to fix Messages Failed to Load error on Discord for Windows

How to fix Messages Failed to Load error on Discord for Windows

How to fix Messages Failed to Load error on Discord for Windows, Discord isn't fun if you can't read what other people write. Here's how to fix Messages error

How to display the This PC icon on the Windows 11 desktop

How to display the This PC icon on the Windows 11 desktop

How to display the This PC icon on the Windows 11 desktop, During the process of using Windows 11, many users need to access This PC (management).

How to find information in the Windows Registry quickly

How to find information in the Windows Registry quickly

How to find information in the Windows Registry quickly, Do you find it difficult to find information in the Windows Registry? So below are quick ways to find the registry

How to limit the number of failed login attempts on Windows 10

How to limit the number of failed login attempts on Windows 10

How to limit the number of failed login attempts on Windows 10. Limiting the number of failed password login attempts on Windows 10 helps increase computer security. Here's how

How to create fake error messages in Windows

How to create fake error messages in Windows

How to create fake error messages in Windows, Windows can come up with some pretty creative error messages but why don't you try creating your own content for them to make fun of?

Ways to open Windows Tools in Windows 11

Ways to open Windows Tools in Windows 11

Ways to open Windows Tools in Windows 11, Windows Administrative Tools or Windows Tools are still useful on Windows 11. Here's how to find Windows Tools in Windows 11.

How to fix Windows Quick Assist not working error

How to fix Windows Quick Assist not working error

How to fix Windows Quick Assist not working error, Windows Quick Assist helps you connect to a remote PC easily. However, sometimes it also generates errors. But,

How to pin Word, Excel and PowerPoint files to the corresponding app icon on the Windows 11 taskbar

How to pin Word, Excel and PowerPoint files to the corresponding app icon on the Windows 11 taskbar

How to pin Word, Excel and PowerPoint files to the corresponding app icon on the Windows 11 taskbar, How to pin Office files to the taskbar icon on Windows 11? Invite

How to fix the error of not being able to install software on Windows

How to fix the error of not being able to install software on Windows

How to fix the error of not being able to install software on Windows, Why can't you install apps or software on Windows 10/11? Here's everything you need to know about how to fix it

Instructions for deleting or changing PIN on Windows 11

Instructions for deleting or changing PIN on Windows 11

Instructions for deleting or changing the PIN code on Windows 11, In Windows 11, the PIN code is a very useful and convenient security tool for users. However some people

How to fix There Are Currently No Power Options Available error in Windows 10

How to fix There Are Currently No Power Options Available error in Windows 10

How to fix There Are Currently No Power Options Available error in Windows 10, Can't select power mode in Windows 10, what should I do? Here's how to fix the error

The simplest way to fix Photos application errors on Windows 10

The simplest way to fix Photos application errors on Windows 10

The simplest way to fix Photos app errors on Windows 10, what should I do if Microsoft Photos doesn't work? Don't worry about ways to fix Photos app errors on Windows

Instructions for installing keyboard shortcuts to switch input languages ​​on Windows 11

Instructions for installing keyboard shortcuts to switch input languages ​​on Windows 11

Instructions for installing shortcuts to switch input languages ​​on Windows 11. During the process of using Windows, users will often have to switch between methods.

How to check supported power status on Windows 11

How to check supported power status on Windows 11

How to check power status is supported on Windows 11, Windows 11 can handle many different power states. Here's how to check the power status

How to switch from 2.4GHz to 5GHz in Windows 10

How to switch from 2.4GHz to 5GHz in Windows 10

How to switch from 2.4GHz to 5GHz in Windows 10, If you want to find a quick and simple way to speed up the Internet, changing the WiFi band from 2.4GHz to 5GHz may help.

How to fix Not Enough Memory to Run Microsoft Excel error on Windows

How to fix Not Enough Memory to Run Microsoft Excel error on Windows

How to fix Not Enough Memory to Run Microsoft Excel error on Windows, Are you having an error of not enough memory to run Microsoft Excel? So, how to fix Not Enough Memory error

Ways to find all video files on Windows

Ways to find all video files on Windows

Ways to find all video files on Windows, Can't find recorded and saved videos on PC. Below are ways to help you find all clips on Windows.