SPY HILL Research Spy-Hill.net


Poughkeepsie, New York [DIR] [UP]

How to Enable the "root" Account on Mac OS X


Last updated: 8 August 2012

Quick Command Line Method

This is the easiest method to enable the "root" account on a Mac if you are more of a Command Line Interface person:
  1. Log in on the Admin account. (Your normal, every day user account should not have administrative privileges!).

  2. Open up a command shell in the Terminal application with
    Macintosh HD -> Applications -> Utilities -> Terminal.

    At the command prompt type this command:

    % sudo passwd root Enter Password: Changing password for root New password: Verify password:
    The first password you are asked for is the already existing password for the Admin account, to prove that you are authorized to make changes to this system. After that, you enter the new root password (twice, for verification). That is all, the "root" account is now enabled, with that password.

Incidentally, it is also relatively easy to add your own personal login to the "wheel" group from the command line. Recall that Mac OS X respects the BSD Unix tradition of only allowing members of the "wheel" group to su to root. We showed a simple way around this above (simply `ssh root@localhost`), but you don't even need to do that if your personal account is in the wheel group. For Mac OS X 10.6 and beyond, which use the Directory Service to keep track of users and groups, the command is simply

# dscl . -append /Groups/wheel GroupMembership "myers"
As the "#" in the command prompt implies, you must be 'root' (or at least an Administrator) to give this command. Don't miss the "dot" after the command name; that is the "data source", and the dot means the local machine, rather than a remote directory service. Be sure to replace "myers" with the name of your own user account. You can verify that it worked with the traditional Unix `groups` command, or by saying
# dscl . -read /Groups/wheel

Start Next >>> <<< Previous



Last modified: Wednesday August 08, 2012 Copyright © 2012 by Spy Hill Research http://spy-hill.net /help/apple/EnableRoot3.html