Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MacOS X Mavericks installation with a single user Admin and empty password for that account:


Now I'm trying to install Cocoapods, but can't use "sudo", because I don't know the root password:

admin@mac:etc> id
uid=501(admin) gid=20(staff) groups=20(staff),401(,12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),398(,399(
admin@mac:etc> id root
uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),3(sys),4(tty),5(operator),8(procview),9(procmod),12(everyone),20(staff),29(certusers),61(localaccounts),80(admin),401(,33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),398(,399(
admin@mac:etc> sudo gem install cocoapods

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Sorry, try again.
Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts

On Linux I would boot the machine in single user mode and set the root password. Or add Admin user to wheel groupd and uncomment this line in /etc/sudoers:

%wheel  ALL=(ALL)       NOPASSWD: ALL

But in MacOS I don't know what to do.

I also can't find the /etc/sudoers when I run text editor or MacVim.

share|improve this question
up vote 6 down vote accepted

Have a look at this Apple Support article. It states:

If your administrator account has no password (a blank password), you must give that user a password before using the sudo command.

After you are done using the sudo command, you can change your account password again, although it is recommended that your administrator account have a non-blank password.

Is there a reason why you can't change the password for this user?

share|improve this answer

Straightforward, you actually have to enable the root user.

1. Click on on Login Options, then unlock the greyed out screen by clicking the Lock icon in the bottom left hand corner, and either Join or Edit Network Account Server.

2.Then choose Open Directory Utility. Click the lock again and authenticate.

3. Go up to the menu bar at the top and you have the option to Enable Root user or if its already enabled change the password.

That is one way to do it.

share|improve this answer
didn't grok that "either Join or Edit Network Account Server" but the rest of it helped.. – ari gold Jan 14 at 20:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .