How to change the password of a LDAP entry as LDAP administrator

Michael Ströder michael at stroeder.com
Thu Jan 15 11:38:24 CET 2009


Guruprasad wrote:
> Guruprasad wrote:
>> Hi all,
>> I am new to this Python-LDAP API and am currently learning and working
>> on it. I, the LDAP admin, want to set the password of a LDAP user
>> after binding as the admin user. I came across passwd_s() method which
>> can be used to change the user password, but requires the old password
>> too. As an admin, I should be able to reset the LDAP passwords of
>> users whose current passwords I do not know. Is there a way to do this?
>>
>> Thanks in advance.
>>
> I figured it out. When I bind as LDAP admin and want to change the
> password of another DN, I just have to give oldpasswd=None. For example:
> 
> ldapobj.passwd_s("DN to delete",None,"newpassword")

Yupp. That's exactly the solution.

Which LDAP server is that?
Mote that the Password Modify Extended Operation is sometimes slightly
differently implemented in various LDAP servers. I came across one
vendor who does not allow the use of this extended operation for an
admin setting another user's password. So if your LDAP client is
supposed to work with any LDAP server you have to do some interop testing.

Ciao, Michael.



More information about the python-ldap mailing list