How to enable root user and password on MacOS Yosemite

Here is another example of Apple making things easy for average users and convoluted for more advanced users.

Trying to set up git on MacOS, you have to run something like this early on:

$ git config --global user.name "User Name"
$ git config --global user.email "user@address.com"

This should work, unless you installed Xcode some time before and forgotten all about it.

In which case, git will warn you that you first have to approve Xcode EULA.

And in order todo that, you have to log in as root.

And in order to do that, you have to enable a root user and password.

Of course, it doesn’t matter if you did exactly that a while ago. The latest upgrade to MacOS changed that setting and disabled that root password for you.

So.. how to enable a root account in MacOS Yosemite?

Google it of course.

In case that link disappears, you have to:

1- Open Users and Groups in the System Preferences

2- Unlock the panel to allow changes (provide a password for an administrator account)

3- Select Login Options

4- Click on ‘Join..’ (for Network account server)

5- Click on Open Directory Utility

6- Unlock THAT panel with an Administrator account

7- Open the Edit menu IN THE TOOLBAR  at the top of the screen and select Enable root user

Then you can use ‘su -‘ to login as root and type ‘git’ there… to display Xcode’s EULA (and scroll down all 20 pages of it in a terminal).

Then you can approve the EULA.

Then you can exit git and the root account.

Then you can run git as yourself.

That was easy wasn’t it?

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: