How to enable the root user or change the root password on Mac
Mac administrators can use the root user account to perform tasks that require access to more areas of the system.
It's safer to use the sudo
command in Terminal instead of enabling the root user. To learn about sudo
, open the Terminal app and enter man sudo
.
The user account named ”root” is a superuser with read and write privileges to more areas of the system, including files in other macOS user accounts. The root user is disabled by default, and it's not intended for routine use. Its privileges allow changes to files that are required by your Mac, and to undo those changes you might need to reinstall macOS. Always disable the root user after completing your task.
Use Directory Utility
Use Spotlight to find and open Directory Utility, or follow these steps:
From the menu bar in the Finder, choose Go > Go to Folder.
Type or paste
/System/Library/CoreServices/Applications/
, then press Return.Open Directory Utility from the window that opens.
To enable or disable the root user
In the Directory Utility window,
, then enter an administrator name and password.To enable the root user, choose Edit > Enable Root User from the menu bar. Then enter the password that you want to use. You can then log in as the root user.
To disable the root user, choose Edit > Disable Root User.
To change the root password
In the Directory Utility window,
, then enter an administrator name and password. From the menu bar, choose Edit > Change Root Password.Log in as the root user
When the root user is enabled, you have its privileges only while logged in as the root user.
Choose Apple menu > Log Out to log out of your current user account.
At the login window, log in with the user name “root” and the password you created for the root user.
If the login window is a list of users, click Other, then log in.
Remember to disable the root user after completing your task.