Announcement

Collapse
No announcement yet.

Change LDAP password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change LDAP password

    Hi forum!

    I use oxldapsync with open-xchange.

    The LDAP server in on a separate host.

    When I change the password in my OX the password is not changed in my ldap. It is possible when I change the password in the OX automatically is changed in the ldap.

    Best regards!

    Joan

  • #2
    You could try to use the package open-xchange-passwordchange-script. That allows to run a script to do such stuff.

    Comment


    • #3
      Hi,

      I install this package, but I don't find any information to buid this script.

      Have you a example script?....

      Thanks!

      Joan

      Comment


      • #4
        I just created an article in the Wiki containing an example:

        Comment


        • #5
          Sorry my ineptitude, but I can't put my command to change the LDAP user password is your script.

          The command that I use to change the password in the LDAP is:

          ldappasswd -h my_ldap_server -D "uid=my_user,ou=people,dc=example,dc=com" -w old_password -s new_password "uid=my_user,ou=people,dc=example,dc=com"

          or if you want prompt passwords:

          ldappasswd -h my_ldap_server -D "uid=my_user,ou=people,dc=example,dc=com" -W -S "uid=my_user,ou=people,dc=example,dc=com"

          Thanks for your attention,

          Joan

          Comment


          • #6
            Hi Joan,

            the open-xchange-passwordchange-script returns some values:

            # 1. --cid - Context ID
            # 2. --username - Username of the logged in user
            # 3. --userid - User ID of the logged in user
            # 4. --oldpassword - Old user password
            # 5. --newpassword - New user password

            if you are using ldappasswd, maybe do you need use /bin/bash scripts with tipical $1,$2,$3 args.

            Please, test it using this example:

            vim /bin/changepw.sh
            #!/bin/bash
            echo ox-return $1 $2 > /tmp/returns.sh

            Regards
            Last edited by dioni; 01-23-2010, 11:30 PM.

            Comment


            • #7
              Hi Dioni,

              It works!, this is my "simple" changepwd.sh to change the ldap password in a openldap server:

              #!/bin/bash
              ldappasswd -h my_ldap_server -D "uid=$4,ou=people,dc=example,dc=com" -w $8 -s ${10} "uid=$4,ou=people,dc=example,dc=com"

              Thanks for yours very usefull instructions!

              Best regards,

              Joan

              Comment


              • #8
                Great!

                I added this as example to

                Comment

                Working...
                X