Although Apple does not recommend opening the root account of Mac OS X, it sometimes encounters some operational difficulties that have to be resolved by opening the root account. So how do I turn on the Root account of Mac OS X?
Open Root Account
Open System Preferences and go to the Users and Groups panel, remember to open the small lock in the lower left corner of the panel and select "Login Options" in the panel. On the right side of the panel you will see "Network account Server", click on the "Join ..." button next to it, then click "Open Directory Utility" in the pop-up window. A new window will pop up, open the small lock in the lower left corner, then click "Edit" on the menu bar – "Enable root user" to set the root password in the popup window.
The above step is a bit verbose, you can press the key combination "SHIFT + COMMAND + G" in the Finder to go directly to the folder/system/library/coreservices and find "directory Utility" to open the root account.
Once enabled, you can log out of the system and sign in to Mac OS X with the Root account you just opened.
Close the Root account
The root account has the highest level of access in our daily life, and in order to avoid various security issues, MACGG recommends that you close the root account after solving the problem with the root account. Close the steps similar to the above, just after opening the "directory Utility", click "Disable Root User" in the "Edit" menu.