Ask Different is a question and answer site for power users of Apple hardware and software. 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 recently changed an account password by accident, and was wondering how to set it back to a blank password via the shell. I have root privileges. Please help :)

passwd USER doesn't accept blank passwords

share|improve this question
You really want a blank password? From a security perspective, that's not at all a good idea. – Kerri Shotts Jun 5 '11 at 3:39
The password prompt used by (the default bash) sudo doesn't accept an empty password either — even if you changed to one you couldn't really use it without some workaround. – user495470 Jun 7 '11 at 14:15

The passwd command rejects the idea that you can have a 0 length password.

Instead use dscl which is more accepting of the notion that the password is nothing.

dscl . -passwd /Users/foo

You can press enter to make the new password blank and then may get an error and have to enter the old password if you are not root but once you authenticate (or are root already) the blank password will be written.

share|improve this answer

You can set the account password to no password using the Accounts Preference Pane in System Preferences.

share|improve this answer
I'd wager the preference pane is calling dscl and not passwd :-) – bmike Jun 3 '11 at 22:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.