0

My question might also be put, "What does System Preferences -> Users & Accounts do to change a user's password that I'm missing in the command line?"

The desktop is joined to both OD and AD directories. I can change my own user's auth with

$ passwd <uname>
... (update pwd through dialog) ...
$ dscl . -passwd /Users/<uname>
... (update through dialog) ...

However, I can't use it for other users. I just get a dscl error -14009 (eDSUnknownNodeName). It doesn't matter if I use a full admin account, sudo -s, or anything.

What else might I try? I really want to be able to do this through terminal so I can write a bash for loop to change the passwords more easily.

  • 1
    dscl . is for the local OS X directory. Unless all the users have been logged in at one point to the Mac you're on, you'll have to specify the path to the directory you're editing, e.g. dscl /Active Directory/All Domains for AD and dscl /LDAPv3/<directory path> for OD. – thankyour May 6 '14 at 17:35
  • No, the account is local, and I CAN change the password with dscl . /Users/<user>, but only if I am that user. However, I CAN also change the password for a different user but only if I go through the System Preferences gui. Why? – labyrinth May 6 '14 at 19:28
  • I created a local test account and changed the password without issue. I then tried to change the password while misspelling the account name and received the same error. Are the local accounts you're trying to change actuall "mobile" accounts from a directory login? – thankyour May 6 '14 at 21:17
  • No, not mobile accounts. But I found that 10.6.8 machines don't have the issue while 10.7.5 do. Anyway, I just worked around it, but I am still interested in knowing exactly what System Preferences does behind the scenes when it deletes a user. Or doesn't do for that matter, because I found that I needed to to run a dscl . -delete /Users/<uname> anyway to clear out some cruft it left. – labyrinth May 6 '14 at 22:07
  • Just did some testing on mavericks. Your commands work fine, if you do the following: passwd username (old password: "password", new password: "password1"), then dscl . -passwd /Users/username (new password: "password1", old password: "password1"). Note that the old password and the new password are the same in the dscl command, but not the passwd command. – bennettp123 May 7 '14 at 7:06

You must log in to answer this question.

Browse other questions tagged .