473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ldap passwd need help

I've got the python-ldap version 2.0.11 with python 2.4 under Linux

I've got the ldap stuff working for groups, but now I'm trying to use it to
change a user password. I get a return of 2 and no error messages but it
does not change ldap.

I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the
same result.

Anyone know what I'm missing?

class LdapUser:
def __init__(self, uri=uri, binddn=BINDDN, password=""):
self.ldap = ldap.initialize(uri)
self.ldap.simple_bind(binddn, password)

def chg_pw(self,uid,oldpw,newpw):
print self.ldap.passwd_s(uid,oldpw,newpw)
if __name__=="__main__":
Ldap = LdapUser(password="secret")
Ldap.chg_pw("uid=joeblow,ou=abc,ou=def,dc=ghi,dc=o rg","", "new.pass")

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------
Jan 18 '06 #1
1 2591
Sells, Fred wrote:

I've got the ldap stuff working for groups, but now I'm trying to use it to
change a user password. I get a return of 2 and no error messages but it
does not change ldap.
Could you please post a complete Python traceback? If you mean "2" being
the LDAP error code this is ldap.PROTOCOL_ERROR.
def chg_pw(self,uid,oldpw,newpw):
print self.ldap.passwd_s(uid,oldpw,newpw)


Make sure your LDAP server (which one?) supports the
LDAP Password Modify Extended Operation (see RFC 3062) when using method
LDAPObject.passwd_s(). ldap.PROTOCOL_ERROR indicates that the server
does not support it.

Otherwise you have to send a modify request replacing the value of
attribute 'userPassword' in the user's LDAP entry. Make sure you
understand password hashes if needed with your server.

Ciao, Michael.
Jan 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
0
by: Ronald Wunderlich | last post by:
Hi, My first Question: can db2 (db2ckpw) ask over pam_ldap my edirectory ldap server for user authentication? The scenario: 1. computer suse linx enterprise server 8(SLES8) and edirectory...
4
by: m96 | last post by:
hi, i'm trying to make a query to a ldap server (version v2 or v3 doen't matter) with c#. the query works just fine but the problem is that i can't read the custom attributes/fields, since .net...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
4
by: Nico Koenig | last post by:
Hi there, I try to make an authorisation bind to the LDAP with ASP.NET. I use the DirectoryServices Namespace and the MSDN documented way to do it, but every time I get an "COMException: Server...
0
by: Sells, Fred | last post by:
I've got the python-ldap version 2.0.11 with python 2.4 under Linux I've got the ldap stuff working for groups, but now I'm trying to use it to change a user password. I get a return of 2 and no...
4
by: Terry Miller | last post by:
I have DB2 V8.2 loaded on a Redhat Enterprise Linux version 3 (RHEL 3) box. RHEL is configured to talk to LDAP for authenticaton besides the local passwd file. I can verify this by executing an su...
0
by: Sells, Fred | last post by:
I'm running python 2.5 (or 2.4) in an XP environment. I downloaded and installed the .dll's from OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in c:/windows/system32 as instructed...
2
by: Lars | last post by:
Hi I got some programming experience and I recently started looking into Python. I've read much of the tutorial from 2.6 documentation. But it was more interesting to get started on something I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.