You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using dscl to set user passwords without interaction

Hello,

I'm trying to write a script to add users, and I'm stuck on setting the password. If I use:

dscl -u adminuser -P adminpass /LDAPv3/127.0.0.1 -passwd /Users/$username $newpass

It adds a crypt password to the ldap server. Users created in this way cannot login to the iChat server (the script is supposed to add new users for ichat). If I use WGM to manually change their password after creation, then they can. Is there some way to either set the password as an 'OpenDirectory' password from the start, or to change the crypt password to an OpenDirectory password, from the command line, without interaction or using Expect?

Thanks!

MBP 15", Mac OS X (10.5)

Posted on May 3, 2008 7:04 PM

Reply
17 replies

Jul 1, 2008 2:32 PM in response to mrstrand

Ping... same here, esp with the two functions mentioned..

I'm also front-ending some centralized server administration, and having this information would be rather nice... especially the UUID piece.

I currently get mine by letting the server create the basic LDAP entry via dscl -create which also plugs in a UUID and sets other required but unknown values to '99'.

For UID, it currently pulls uidnumber for all records, sorts them and then pulls highest val + 1.. I suspect you're doing similar, or you have another database.. but if you have other insight, I'd love to know. Anyway, I hate the sequential scan for a single add.. but account adds only happen so often, and bulk loads can be preassigned.

Using dscl to set user passwords without interaction

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.