How to Make Yourself an Administrator From the Terminal on a Mac

By Michael Cox

For security, it takes an administrator to create an administrator.
i Justin Sullivan/Getty Images News/Getty Images

The Mac OS X Terminal allows you to control your computer without a graphical interface. This includes creating new users, changing passwords and even granting permissions on any of your office Macs. You can change a colleague's user account -- or your own -- to an administrator account that allows more control over the computer. But you need either an existing administrator's password or that of the Mac's root user to do it.

Start your Mac and log in as an administrator or the root user. To log in as the root user, click "Other" in the login window, enter "root" in the "Name" box and the root user's password in the "Password" box. If there isn't an "Other" option, the root user is not enabled on your Mac.

Open Terminal by double-clicking it in the "Utilities" folder in your "Applications" folder or searching for it in Spotlight.

At the Terminal prompt, enter the following command:

sudo dscl . -create /Groups/admin GroupMembership username

Substitute your username for "username."

Press the "Return" key and when prompted, enter the password for the account you logged in with. Terminal will return a blank prompt.

Quit Terminal and choose "Log Out [Username]" from the Apple menu. You may now log in with your former user account, which now has administrator privileges.


Although a root user is created by default when you install OS X, it isn't enabled by default. To enable the root user, log in to your Mac as an administrator, choose "Go to Folder" in the Finder, enter "/System/Library/CoreServices/" and click "Go." Double-click Directory Utility in the "CoreServices" folder, click the "lock" icon and enter the administrator's password. Choose "Enable Root User" from the Edit menu.