How to Enable the Root User on Your Mac

Root user is a special user account on your Mac that allows you to modify the system files that were not available to you before. What this means is you can have full control over all the functions of your machine. While this may help advanced users to do their tasks, most beginners just should not use it. Apple knows it very well, and that is why the account comes disabled by default. However, you can enable it and perform your tasks, if you wish.

There are actually two ways to enable root user on a Mac. The first method makes use of Terminal and the second one uses GUI to help you enable the root user on your machine. Here’s how you can use both of them:

Fire-up Terminal on your Mac. To do that, click on Launchpad in your dock and search for and click on “Terminal.” It will launch on your machine.

rootuser-terminal

Type in the following command into the Terminal Window and press Enter. It is the command that helps you enable the root user account on your Mac.

rootuser-enable

It should then ask you to input your current user password. Just type in your password and press Enter.

rootuser-password

You will now be asked to enter a password for the root user account. Make sure to choose a strong password for this account as it has more privileges than any other accounts on your Mac.

rootuser-rootpassword

You will need to enter the same root password again to confirm you typed it correctly in the first prompt.

rootuser-verifypass

Once it is done, you should see a message that says “Successfully enabled root user”.

rootuser-success

As you may have already guessed, the root user account is now enabled on your machine and you can start using it right away to accomplish your tasks that can’t be done with a normal user account.

If you are done with your tasks and wish to disable the root user account as it is of no use anymore, you can do so using the following steps.

Launch Terminal from the Launchpad on your Mac.

Type in the following command into the Terminal Window and press Enter. It is for disabling the root user on a Mac.

rootuser-disable

You will be asked to enter your current user account password. Do so and press Enter.

rootuser-currentpass

You should see a message saying “Successfully disabled root user”.

rootuser-disabled

The root user account is now disabled on your Mac.

If you prefer using GUI rather than Terminal, here’s how you can enable the root user that way:

While on your desktop, click on “Go” followed by “Go to Folder…”.It lets you quickly jump to a specific directory on your Mac.

rootuser-gotofolder

When it launches, type in the following path into the box and click on “Go.” You should be taken to that directory on your machine. That directory is where the tool to enable the root user is located.

rootuser-path

When the directory launches, find the tool that says “Directory Utility” and double click on it to launch it.

rootuser-directory

You must first unlock the opened tool to be able to make any changes. To do that, click on the Lock icon in the panel and enter your user account password. Then, click on “Modify Configuration.” You should now be able to make changes in this tool.

rootuser-unlock

Click on “Edit” followed by “Enable Root User.” It is the option that allows you to enable the root user account on your Mac.

rootuser-enablerootuser

You should now be asked to enter a password for the root user account. Enter any password that you think is strong and click on “OK.” It will save the settings for you.

rootuser-setpass

And you are done.

The root user is now enabled with your chosen password and is ready for use.

To disable the root user using GUI, click on “Edit” followed by “Disable Root User”.

Every Mac comes with a user account called Root User that allows users to access and modify system files and to troubleshoot any issues. The guide above helps you to enable this hidden account and get more privileges than your ordinary user account on your Mac.

10 comments

  1. Sorry Mahesh, enabling root on any UNIX, Linux or OS/X system is an extremely bad practice. It’s guaranteed to mess up permissions on anything you create/update while logged in as root when you disable root. This almost always results in users just running as root all the time, which if they use the internet at all (and who doesn’t) the door for escalation of privilege attacks is now wide open. In essence you’ve disabled security on your Mac. Apple has always provided the sudo command line app that allows any admin user (not guest or standard user) to run a single command using thier own password.

    For example: sudo rm -rf *

    Sudo does more than allow limited superuser access, it logs the activity so that when you mess something up as root – as you inevitably will – you can find out what you did by looking at the sudo log. I’ve been using OS/X since Jaguar and I’ve never enabled root because I’ve never needed to and you don’t either.

    make tech easier is usually more responsible than to publish such a naive piece. Hopefully your users will never try this.

    • Hello Joseph,

      Thanks for stopping by and leaving us a comment!

      Root user is one of the built-in functions of Mac and there must be a reason why Apple included it in its OS.

      As said in the beginning of the article, most beginners just should NOT use this function, unless they know what they are doing with it. This function is meant for advanced users who know how to not mess-up with their machines.

      Thanks!

      • Mahesh,

        root (superuser) is on every UNIX, Linux and OS/X system and must be there to bootstrap and perform system level ring 0 commands. The “dsenableroot” command exposes the root user and it’s associated permissions (i.e EVERYTHING – which is why root is the superuser). On OS/X out of the box root has a random password, unknown by anyone including Apple. This is precisely to limit any user, including admin users, from damaging the system irretrievably without the audit trail provided by sudo.
        Apple provided that command specifically because they disallow the following command:
        sudo su –
        (which uses sudo to become root in that shell)
        The only time I can imagine having root access from all shells being necessary would be for something like constructing and mounting a hardware RAID setup or needing direct access to a bus or fiber channel. That or trying to repair damage done by someone who bricked their Mac by messing about as root.
        There are no users – including me – who “know how to not mess-up with their machines”. I can’t count the number of times that a sudo log has allowed me to revive a machine (UNIX, Linux and OS/X) that wouldn’t boot out of init 1 (single user mode) or even EFI.
        My point is that the security risk incurred by exposing superuser globally via a password (what you did when you “enabled” root) vastly outweighs any possible benefit. Just check out the Pwn2Own (https://en.wikipedia.org/wiki/Pwn2Own) contest and realize that you just made the job much easier when simply cracking the root password will do it rather than something at least a little challenging.

        Hope this helps explain a bit better.

        • Hello Joseph,

          Thank you for such a detailed explanation of the feature!

          The aim of this article is to teach users how they can enable the Root User on their Mac. Period.

          It doesn’t go in-depth to cover why a user should use this root user, what benefit/damage it can cause to the system, why they should use “shell-root” instead of superuser, etc.

          To give you an example, there are numerous Android rooting guides out there, and as you may already know, rooting lets you delete system files which can cause the device to become unresponsive. So what are those guides for? Those are for experienced users who know what they are doing with their devices.

          Similarly, this guide teaches how you can go about enabling the root user on your Mac. The user is the one who decides what to do with this root-user account, we just help him/her enable the functionality.

          Thanks once again!

        • Joseph, Mahesh:

          What would happen after the root user is enabled and then disabled. Does the root access password become random again, or once the root user gets enabled for the first time, it ceases to have a random password?

          • Awan:

            Great question. I’m not sure but I suspect that once you set a password on OS/X you can only reset it to something different.

            There are some distros of Linux and BSD (so maybe OS/X) that will offer to generate a random password when changing,

  2. “As said in the beginning of the article, most beginners just should NOT use this function, unless they know what they are doing with it. This function is meant for advanced users who know how to not mess-up with their machines.”

    I’m sorry, but any advanced user if needs access to root user, alredy knows how to enable and access root user. The only users which might use your guide are unexpirienced users and this users might caused themselfs more problems but not using carefuly. And for that reason, if you are posting about “how to access root account”, you should take a bit more time and effort to describe possible threats.

    I’m on Joseph on that one…

  3. And one more thing, advanced user knows, that should never use root account and if root user privileged is required, it should use sudo.

    Open terminal and type “man sudo”. You might learn something new…

  4. My problem was that when I booted terminal, and did the dsenableroot command, it wouldn’t let me type the
    password for the user password or the root password. I’m expert with computers, but I know that this problem
    has to do with sudo permissions (iWoo pointed that out). If it is possible to edit this post, try figuring out how to
    get the sudo perms to set the root password. That would help others find how to get the root activated.

    MESSAGE FOR THE KIDS: If you want to annoy your parents, and succeed in booting root (I used this trick plenty when
    I was young) you can use the root account to become “Super Admin”.

  5. One thing for iWoo to consider. There is a first time for everything. Expert users are not born, they sometimes stumble there way to the top. In my case, I have 2 hard drives in my iMac. The os resides in a smaller solid state drive, and so that is where the home folder resides by default. This left my 2 TB second drive doing nothing. In order to move the the home folder to the 2 TB drive I had to learn how to do it, and doing it by the root user is the best way. As I was an experienced PC user, new to the mac, I decided to take on the challenge, and learned a lot about the mac os in the process.

    I love the “man sudo” command. I didn’t know about that, thanks!

Comments are closed.

Sponsored Stories