Languages

Mac OS X: sudo command requires a non-blank admin password

The sudo Terminal command can be used by administrators to execute commands as a different user (for example, as root). When executing this command, you will be prompted to enter the password for the administrator account you are currently logged in as.

The sudo Terminal command can be used by administrators to execute commands as a different user (for example, as root). When executing this command, you will be prompted to enter the password for the administrator account you are currently logged in as.

In Mac OS X v10.5 through 10.5.8, if you press the Return key at the password prompt without entering a password (even if the user has no password, which is not recommended), the command entered will not execute and you will be returned to a command prompt.

In Mac OS X v10.6 or later, if you press the Return key at the password prompt without entering a password, the message "Sorry, try again." will be displayed and you will be prompted for a password again.

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.

Additional Information

Notes: 

  • Many commands in Terminal will return you to a command prompt without displaying any messages after the command executes successfully. You can be assured that the command used with sudo is being executed anytime you enter a non-blank password at the prompt, and you are returned to a command prompt with no other messages displayed.
  • When typing the user's password after the "Password:" prompt appears, you will not see anything appear in the Terminal window. Just type in the password and press Return. If the password is entered incorrectly, you will see the message "Sorry, try again" and be given another chance to enter the password correctly.
Last Modified: Jun 7, 2012
Helpful?
Yes
No
  • Last Modified: Jun 7, 2012
  • Article: HT4103
  • Views:

    67675
  • Rating:
    • 20.0

    (1 Responses)

Additional Product Support Information

Start a Discussion
in Apple Support Communities
See all questions on this article See all questions I have asked