docker-openldap icon indicating copy to clipboard operation
docker-openldap copied to clipboard

sha512 is not working for inetOrgPerson

Open mgcrea opened this issue 8 years ago • 5 comments

Did setup a few users with a SHA512 password:

eg:

dn: cn=foo,cn=users,dc=bar,dc=com
cn: foo
gidnumber: 500
givenname: Foo
homedirectory: /home/users/foo
mail: [email protected]
objectclass: inetOrgPerson
objectclass: posixAccount
objectclass: top
sn: Test
uid: foo
uidnumber: 1002
userpassword: {SHA512}0D6uKWnyA2oU3xvnW7m5Rc2e+YNv3lbhPYisfBamreqqzkpiblhSDe
 7UTyfTIU9RbWfpxn+Cnq3kLIfuXyK0lQ==

I can't login with:

root@df5640e56d9d:/# ldapwhoami -vvv -H ldapi:/// -D cn=foo,cn=users,dc=bar,dc=com -x -w mypassword
ldap_initialize( ldapi:///??base )
ldap_bind: Invalid credentials (49)

As soon as I switch hashing function (sha1), I can login properly.

mgcrea avatar Nov 29 '16 16:11 mgcrea

Pull request welcome to add overlay slapo-pw-sha2 :)

osixia avatar Nov 29 '16 22:11 osixia

There is pw-sha already builded in last openLDAP release. You just need to turn it on in dn: cn=module{0},cn=config

ldif could be:

dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: pw-sha2
-

konstantinbarkalov avatar Apr 21 '17 03:04 konstantinbarkalov

@konstantinbarkalov Thanks!

xyalan avatar Dec 26 '17 14:12 xyalan

@konstantinbarkalov, how can I turn it on? When I login with config password it fails on import:

image

trallnag avatar Jul 07 '21 21:07 trallnag

Ok I logged into the server created the file file.ldif

dn: cn=module{0},cn=config
changetype: modify
add: olcModuleLoad
olcModuleLoad: pw-sha2
-

And then executed following command:

ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f file.ldif

to create pw

slappasswd -h '{SHA512}' -o module-load=pw-sha2

trallnag avatar Jul 07 '21 21:07 trallnag