Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LDAP to change user password

As I know, in PHP, we need to connect LDAP over SSL in order to change user password.

Is there another way, E.G, other language (JAVA / ASP) to change LDAP password without SSL required?

Thanks.

Updates: I get "Warning: ldap_mod_replace() [function.ldap-mod-replace]: Modify: Insufficient access" when I try to modify self account password. If i try to change other user password, I get no error message, but the password still stick to the old one.

like image 227
neobie Avatar asked Jan 27 '11 02:01

neobie


People also ask

How do I change a user password in Active Directory?

Log in to a domain-connected computer and open the Active Directory Users and Computers console. Find the user account whose password you want to reset. In the right pane, right-click on the user account and select Reset Password. Type the new password and enter it again to confirm.

How passwords are stored in LDAP?

LDAP passwords are normally stored in the userPassword attribute. RFC4519 specifies that passwords are not stored in encrypted (or hashed) form. This allows a wide range of password-based authentication mechanisms, such as DIGEST-MD5 to be used. This is also the most interoperable storage scheme.

How do I change my LDAP password in Linux?

Here is how a user can change their own password: [root@ldap ~]# ldappasswd -H ldapi:/// -x -D "uid=testuser,ou=users,dc=tylersguides,dc=com" -W -S uid=testuser,ou=users,dc=tylersguides,dc=com New password: Re-enter new password: Enter LDAP Password: Notice how you use the DN of the user for the bind DN.

Does LDAP do authentication?

LDAP is used as an authentication protocol for directory services. We use LDAP to authenticate users to on-prem and web applications, NAS devices, and SAMBA file servers.


2 Answers

Many LDAP implementations do indeed require SSL or TLS in order to change/set passwords. This is a requirement set by the LDAP server, not the language used to access it. Changing languages will not permit you to override this particular server requirement.

I understand that there are extenuating circumstances where you may not be able to establish a SSL/TLS connection, but in general, you absolutely want to be encrypting password functions like this - even if the server doesn't require it.

Edit: I bet the answer can be founds in the slapd logs. Also worth reviewing the ACLs: OpenLDAP Software 2.4 Administrator's Guide, Section 8. Access Control.

like image 169
xelco52 Avatar answered Oct 05 '22 22:10

xelco52


The directory stores password values in the userPassword attribute of the user entry. Depending on the access control settings for the server, users may set the value of userPassword in accordance with the password policy you specify, using standard tools, such as ldapmodify for example.

ldapmodify -h host -p port -D "cn=Directory Manager" -w password
dn: uid=bjensen,ou=People,dc=example,dc=com
changetype: modify
replace: userPassword
userPassword: ChAnGeMe
like image 25
Raja Avatar answered Oct 06 '22 00:10

Raja