How to Enable the Root User on macOS

Enabling the root user on your Mac grants you full control over the macOS file system. To do so, please follow the steps outlined below.


macos root user enable

On macOS, certain portions of the file system are restricted by default, even for the administrator account. However, it is possible to enable the root user on your Mac, granting you complete read and write privileges across the entire file system. Enabling the root user can be useful in situations such as recovering access to a forgotten username or password, or when dealing with a company-issued macOS device that an ex-employee has not shared the login details for. To enable the root user on macOS, follow the steps outlined below.

How to Enable Root User via the Terminal

macos sonoma terminal app

You can indeed enable root access on your Mac through the Terminal.

Alternate 1:

  • Open a new Finder window by clicking on the Finder icon in the dock (the blue and white smiling face).
  • In the menu bar at the top of the screen, click on “Go.”
  • From the dropdown menu, select “Utilities.”
  • In the Utilities folder, you will find the Terminal application. Double-click on it to launch the Terminal.

Alternate 2:

  • Press the Command (⌘) and Spacebar keys together to open Spotlight.
  • In the Spotlight search bar that appears, type “Terminal” and press Enter or click on the Terminal application in the search results.
  • The Terminal application will launch and open a new Terminal window.

In Terminal, type dsenableroot and press Enter.

macos sonoma root user enabled

At the prompt, enter your username and password, and press Enter. Proceed by entering your desired root password and verifying it. Afterward, you should receive a success message, confirming the successful activation of the root user.

macos enabled root access

How to Enable Root User Using the Directory Utility

If you would rather utilize a graphical user interface (GUI) to activate the root user on your Mac, you can opt for the Directory Utility instead of utilizing the Terminal.

  1. Access the Spotlight feature on your Mac by either clicking the icon located in the upper-right corner of the menu bar or by pressing the Command + Space key combination.
  2. In the Spotlight window, enter the search term “directory utility,” and once the application appears in the search results, select it.
macos directory utility root account
  1. In the Directory Utility window, click the lock icon in the bottom left corner to make changes. You may need to enter your administrator username and password.
macos directory utility admin password
  1. Once the lock is unlocked, go to the “Edit” menu at the top of the screen and select “Enable Root User.”
macos directory utility admin password
  1. A pop-up window will appear, asking you to set a password for the root user. Enter your desired password and confirm it.
  2. Click “OK” to enable the root user with the provided password.

FAQs Enable the Root User on Mac

Is it possible to change the username for the root user account?

No, the default username for the root account on macOS devices is “root,” and it cannot be changed.

Can I use the same password for both my Mac user account and the root user account?

Technically, you can set the passwords to be the same. However, it is not recommended. If someone knows your Mac’s password, they will also have access to the administrative privileges of the root user account, which poses a security risk.

Is it advisable to keep the root user enabled?

No, it is not recommended. Enabling the root user provides complete control over your Mac, which can be beneficial for advanced users. However, it also increases the chances of unintentional damage to your device or making it vulnerable to attacks. Apple disables root access by default for security reasons. It is advisable to disable the root user after performing necessary administrative tasks on your Mac to ensure its safety.