Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to enable root access/create a root profile in the MacBook Pro, the article in the apple support page needs modification

I was following the instructions in this support page: How to enable the root user on your Mac or change your root password - Apple Support and I do not see "Edit > Enable Root User" options in my Directory Utility page (please refer the screenshot). Thanks in advance!





MacBook Pro

Posted on Oct 12, 2022 1:04 PM

Reply
8 replies

Oct 12, 2022 2:30 PM in response to Grant Bennet-Alder

No I didn't change the password. This is actually new MacBook and I was looking to login as root by following these instructions:


Enable or disable the root user

  1. Choose Apple menu () > System Preferences, then click Users & Groups (or Accounts).
  2. Click , then enter an administrator name and password.
  3. Click Login Options.
  4. Click Join (or Edit).
  5. Click Open Directory Utility.
  6. Click  in the Directory Utility window, then enter an administrator name and password.
  7. From the menu bar in Directory Utility:
    • Choose Edit > Enable Root User, then enter the password that you want to use for the root user.
    • Or choose Edit > Disable Root User.


Quick question: what does it usually show in the Directory Utility for someone who has root access in their Mac? My machine shows Active Directory and LDAPv3 shown in the screenshot of this thread

Oct 12, 2022 2:44 PM in response to suryateja910

Many features of root have been deprecated or removed to reduce attacks by malicious software.


The sudo command allows you to execute one terminal command 'as if you were root', it does not turn you into Root.

sudo suffices for MANY purposes, and is the recommended method.


Terminal commands are like a box of VERY sharp tools. If you reach into the box without understanding all the options, it WILL cut your fingers off.


Directory Utility and the article you found are very old, and are no longer used for that purpose.


Oct 12, 2022 4:13 PM in response to suryateja910

As @Grant has already mentioned there is no reason to enable the root user account. Only very old school *nix admins will insist on having a root user account these days since that is what they are familiar with, but there are multiple reasons to avoid having a root user account activated.


If you cannot perform some action using "sudo", then it either means you are trying to do something incorrectly or too complex for a single line. When this happens, you should consider other approaches to performing the action. In rare cases you may want to verify a complex command works as root since a complex command involving "sudo" can be difficult to create (usually best to create a small script at that point -- again another method not requiring a root user account), but you can easily get access to a root prompt without enabling a root user by using (there may be better options to include):

sudo  su  -


FYI, you need to use the admin account password for the admin user account you are currently using (not your AppleID password).


What is the exact command you are trying to run? The partial error message you provided seems like you may have used "su" instead of "sudo", but the error message you provided doesn't seem like it the exact complete error message.


Did you try using "sudo" from another admin user account like @Grant suggested? This will tell us whether the problem is system wide or just an issue with your main user account. Very important information.


Also, are you using any anti-virus software, cleaning apps, or third party security software? If so, then they might be the source of your problem since they interfere with the normal operation of macOS.


Is this Mac being managed by a school or business? If you purchased this Mac through a school or employer, it may have been configured from the factory to be managed by the school or business MDM even if it is your own personal Mac (another user recently discovered this on their brand new "personal" Mac). A managed Mac may be configured to prevent access to "sudo" even if you are an admin user. Technically it would be possible to configure "sudo" to block itself if you or some app customized the "sudoers" configuration.


Again, do not enable the root user account as there is no good reason for it which is why Apple has made it even more difficult to enable these days. Plus even being root won't allow you to access or modify certain parts of macOS or the file system due to the very increased security Apple has implemented within macOS. "sudo" should be able to do everything you need from root access.

How to enable root access/create a root profile in the MacBook Pro, the article in the apple support page needs modification

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.