Share
Explore

Creating an admin root ID on your Mac OS

Even when you are running as root, you will sometimes need to sudo your commands.
megaphone

In macOS, the "sudo" command stands for "superuser do." It allows users with the necessary privileges to execute commands with the security privileges of another user, typically the superuser or root. When you use "sudo" before a command in the terminal, it grants temporary administrative rights to that command, enabling you to perform actions that would normally require superuser access. This can include installing software, modifying system files, and other administrative tasks. It's important to exercise caution when using "sudo" as it can make significant changes to the system and should only be used when necessary.


Creating an admin root ID on your Mac OS involves
enabling the root user, which 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 is 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
.
Here are the steps to enable the root user:
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
.
In the Directory Utility window, click the lock, 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 log 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 set when enabling the root user
.
Remember, 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
.
After you've completed your task, it's important to disable the root user again for security reasons. To do this, go back to the Directory Utility, click the lock, enter an administrator name and password, and choose Edit > Disable Root User
.
Please note that enabling and using the root user should be done with caution as it provides full access to the system and its files. It's generally recommended to use an admin account for tasks that require elevated privileges and to keep the root user disabled for routine use
.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.