Home > Wiki Tips

 An Explanation of Root User on Mac

Updated on Tuesday, December 3, 2024

Written by

Amanda Wong

Approved by

Jessica Shee

English

Summary: This post explains what is root user on Mac. Plus how to enable it and log in as the root user on Mac when it is required to perform some tasks.

There are different kinds of user accounts on the macOS platform, including the administrator user account, standard user account, and root user account. macOS gives these accounts different privileges to make setting changes on Mac. In this post, we are going to know what is a root user on Mac and how to enable it to use.

What is a root user on Mac?

A root user or superuser is a user who has more read and write privileges to files and programs in Unix-like OSes such as macOS. According to Apple, a root user on Mac has rights or permissions to all areas of the file system in OS X 10.10 or earlier, but the root user's write access to certain areas of the file system is restricted in OS X 10.11 or later due to SIP, a security feature.

That is to say, except for the protected parts of the Mac operating system, a root user can access all the rest system folders and apps on your Mac as well as modify them on OS X EI Capitan, macOS Sierra/High Sierra/Mojave/Catalina/Big Sur/Monterey. Most Mac users have updated macOS to these versions. And the root user is disabled by default on your Mac.

How to enable the root user on Mac?

Follow the steps below to enable the root user on your Mac when it is necessary such as reading Mac Console logs. But note that, it is safer to run sudo in Mac Terminal to perform tasks that requires superuser privilege.

  1. Choose the Apple menu > System Preferences, then click Users & Groups.
  2. Click on the padlock icon, enter an administrator name and password, then click Unlock.
  3. Click Login Options on the lower area of the left column.
  4. Click on the Join button next to Network Account Server.
  5. Tap Open Directory Utility.
  6. Click the padlock icon in the Directory Utility window, enter your administrator name and password, then choose Modify Configuration.
  7. From the menu bar in Directory Utility, choose Edit > Enable Root User, then enter a new password and verify it.
  8. Click on the OK button.

How to log in as a root user on Mac?

After you have enabled the root user on Mac, you have disabled the FileVault and the automatic login on Mac before you can log in as a root user on your Mac. Here's how:

To turn off FileVault:

  1. Click the Apple menu, and navigate to System Preference > Security & Privacy.
  2. Select the FileVault tab.
  3. Click the lock at the left bottom and enter your password when asked.
  4. Click Turn Off FileVault.

To disable automatic login:

  1. Head to the Apple menu > System Preferences > Users & Groups.
  2. Click the lock and enter your admin name and password.
  3. Tap the Login Options.
  4. Then set the Automatic Login to Off.

To log in as a root user:

  1. Choose the Apple menu > Log Out [name of current user account], then click Log Out on the pop-up window.
  2. At the login window, log in with the user name ”root” and the password you created for the root user.

How to change the root password on Mac?

After you have enabled the root user account on your Mac, you can change the root password within a few steps:

  1. Choose Apple menu > System Preferences > Users & Groups.
  2. Click the lock icon, then enter your administrator name and password.
  3. Click Login Options, then click Join > Open Directory Utility.
  4. Click the lock icon in the new window, then enter your administrator name and password.
  5. From the menu bar, choose Edit > Change Root Password…, then enter a new root password.

How to disable the root user on Mac?

You'd better disable the root user after you complete the tasks to avoid accidentally causing problems, then only reinstalling macOS can solve them. Check how to disable the root user on your Mac:

  1. Log out of the root user account and log in to your administrator account.
  2. Navigate to the Apple menu > System Preferences > Users & Groups.
  3. Unlock the lock with the administrator's name and password.
  4. Choose Login Options, then click on Join > Open Directory Utility.
  5. Unlock the lock again, then choose Edit > Disable Root User from the menu bar.

Bonus tip: enable/disable the root user with Terminal

In addition to the Directory Utility, you can also use commands in Terminal to enable or disable the root user on your Mac.

  1. Open Finder > Applications > Utilities > Terminal, double-click to launch it.
  2. Type one of the commands(the first one for enabling, the second one for disabling) below to manage the root user:dsenablerootdsenableroot -d
  3. Press Enter and type your password to confirm.