Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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. –  Lri Jun 7 '11 at 14:15
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.