Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change password using LDIF file

Tags:

ldap

ldif

I have an LDIF file which contains a bounch of test users.

I would like to change the password for some of these users and was wondering what would be the best way to do so?

like image 440
Joly Avatar asked May 11 '12 14:05

Joly


1 Answers

Use ldapmodify with LDIF, for example:

ldapmodify -h hostname -p port -D dn -w password <<!
dn: uid=user,dc=example,dc=com
changetype: modify
replace: userPassword
userPassword: new-password
!

or specify a filename:

ldapmodify -c -a -f file.ldif -h hostname -p port -D dn -w password

Of course, use the correct attribute names, distinguished names, and so forth. The distinguished name used for the bind of the ldapmodify tool must have access rights to modify the password of the distinguished name specified in the LDIF.

see also

  • LDIF: rfc2849
  • LDAP: Using ldapmodify
like image 141
Terry Gardner Avatar answered Sep 23 '22 05:09

Terry Gardner