wstrucke wrote:
I've been using some php scripts i wrote to do this rather successfully. we use it to add single accounts, add batch accounts from our databases, reset passwords, etc...
if you are using a shell script I'm not sure how you would add the account offhand. if you can create the account and get it to the point where the user has a crypt password as you indicated above, use this line to convert it to an open directory password:
dscl -u adminusername -P adminpassword /LDAPv3/serverip -passwd /Users/clientusername newpassword 2>&1 &
I'm encouraged to hear that you managed to create working accounts with PHP. I'm actually doing the same thing, but I didn't want to give the webserver direct access to the directory/password servers, so instead the PHP scripts create a template, that are later read by a privileged script.
Anyways -- the dscl command that you posted is exactly the same as the one in my original post. It creates the {crypt} password in OD. So, I wonder what the difference is between what we're doing...
This part of your comment was interesting:
if you are using a shell script I'm not sure how you would add the account offhand.
How are you adding them with PHP? Are you using PHP's LDAP functions to add to the directory? How do you get a password into the PasswordServer?
With my script I'm doing:
dscl -u adminuser -P adminpass /LDAPv3/127.0.0.1 -create /Users/$username
Then I add attributes using the same syntax with "AttributeName $attribute_value" appended. The attributes I add are: UserShell, RealName, FirstName, LastName, UniqueID, PrimaryGroupID, IMHandle, and MailAttribute.
Then I run the -passwd command that you mentioned. This gives me a user with a {crypt} password in LDAP that is unable to authenticate to services.
What are you doing differently?
Many thanks!