How to add to openLDAP user objectClass











up vote
0
down vote

favorite












I have to clone data between two openLDAP servers. I obtain LDIF from source but I have a problem with import. I have error like

root@dc:/etc/ldap/schema# ldapadd -Y external -H ldapi:/// -f /tmp/export.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=Tomasz Topolski,ou=Pracownicy,dc=tropico,dc=local"
ldap_add: Invalid syntax (21)
additional info: objectClass: value #3 invalid per syntax



After googling I saw that problem is with 4th objectClass (because it start counting from 0), so i check and 4th objectClass in my exported ldif is

objectClass: user

And main question is. How to add this objectClass to my LDAP ?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have to clone data between two openLDAP servers. I obtain LDIF from source but I have a problem with import. I have error like

    root@dc:/etc/ldap/schema# ldapadd -Y external -H ldapi:/// -f /tmp/export.ldif
    SASL/EXTERNAL authentication started
    SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
    SASL SSF: 0
    adding new entry "cn=Tomasz Topolski,ou=Pracownicy,dc=tropico,dc=local"
    ldap_add: Invalid syntax (21)
    additional info: objectClass: value #3 invalid per syntax



    After googling I saw that problem is with 4th objectClass (because it start counting from 0), so i check and 4th objectClass in my exported ldif is

    objectClass: user

    And main question is. How to add this objectClass to my LDAP ?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have to clone data between two openLDAP servers. I obtain LDIF from source but I have a problem with import. I have error like

      root@dc:/etc/ldap/schema# ldapadd -Y external -H ldapi:/// -f /tmp/export.ldif
      SASL/EXTERNAL authentication started
      SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
      SASL SSF: 0
      adding new entry "cn=Tomasz Topolski,ou=Pracownicy,dc=tropico,dc=local"
      ldap_add: Invalid syntax (21)
      additional info: objectClass: value #3 invalid per syntax



      After googling I saw that problem is with 4th objectClass (because it start counting from 0), so i check and 4th objectClass in my exported ldif is

      objectClass: user

      And main question is. How to add this objectClass to my LDAP ?










      share|improve this question













      I have to clone data between two openLDAP servers. I obtain LDIF from source but I have a problem with import. I have error like

      root@dc:/etc/ldap/schema# ldapadd -Y external -H ldapi:/// -f /tmp/export.ldif
      SASL/EXTERNAL authentication started
      SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
      SASL SSF: 0
      adding new entry "cn=Tomasz Topolski,ou=Pracownicy,dc=tropico,dc=local"
      ldap_add: Invalid syntax (21)
      additional info: objectClass: value #3 invalid per syntax



      After googling I saw that problem is with 4th objectClass (because it start counting from 0), so i check and 4th objectClass in my exported ldif is

      objectClass: user

      And main question is. How to add this objectClass to my LDAP ?







      ldap openldap






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 7:32









      przeqpiciel

      1738




      1738
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          If you are looking for migrating all configs, can use slapcat with "-n 0" as parameter to export the all configs including schema. Then, can add the schema first and then data.



          But, if only this particular objectclass "user" is needed, then can follow below steps




          1. Create a file user.schema with contents same as the source OPENLDAP user objectclass definition.

          2. Create conf file user.conf
            include ~/user.schema


          3. Create a directory and run below commands



            mkdir userdir



            slaptest -f user.conf -F userdir




          4. The resulting file in userdir can be used to add to schema



            service slapd stop



            slapadd -l -n 0



            service slapd start








          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185140%2fhow-to-add-to-openldap-user-objectclass%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            If you are looking for migrating all configs, can use slapcat with "-n 0" as parameter to export the all configs including schema. Then, can add the schema first and then data.



            But, if only this particular objectclass "user" is needed, then can follow below steps




            1. Create a file user.schema with contents same as the source OPENLDAP user objectclass definition.

            2. Create conf file user.conf
              include ~/user.schema


            3. Create a directory and run below commands



              mkdir userdir



              slaptest -f user.conf -F userdir




            4. The resulting file in userdir can be used to add to schema



              service slapd stop



              slapadd -l -n 0



              service slapd start








            share|improve this answer

























              up vote
              0
              down vote













              If you are looking for migrating all configs, can use slapcat with "-n 0" as parameter to export the all configs including schema. Then, can add the schema first and then data.



              But, if only this particular objectclass "user" is needed, then can follow below steps




              1. Create a file user.schema with contents same as the source OPENLDAP user objectclass definition.

              2. Create conf file user.conf
                include ~/user.schema


              3. Create a directory and run below commands



                mkdir userdir



                slaptest -f user.conf -F userdir




              4. The resulting file in userdir can be used to add to schema



                service slapd stop



                slapadd -l -n 0



                service slapd start








              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                If you are looking for migrating all configs, can use slapcat with "-n 0" as parameter to export the all configs including schema. Then, can add the schema first and then data.



                But, if only this particular objectclass "user" is needed, then can follow below steps




                1. Create a file user.schema with contents same as the source OPENLDAP user objectclass definition.

                2. Create conf file user.conf
                  include ~/user.schema


                3. Create a directory and run below commands



                  mkdir userdir



                  slaptest -f user.conf -F userdir




                4. The resulting file in userdir can be used to add to schema



                  service slapd stop



                  slapadd -l -n 0



                  service slapd start








                share|improve this answer












                If you are looking for migrating all configs, can use slapcat with "-n 0" as parameter to export the all configs including schema. Then, can add the schema first and then data.



                But, if only this particular objectclass "user" is needed, then can follow below steps




                1. Create a file user.schema with contents same as the source OPENLDAP user objectclass definition.

                2. Create conf file user.conf
                  include ~/user.schema


                3. Create a directory and run below commands



                  mkdir userdir



                  slaptest -f user.conf -F userdir




                4. The resulting file in userdir can be used to add to schema



                  service slapd stop



                  slapadd -l -n 0



                  service slapd start









                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 8 at 16:16









                A_P

                113




                113






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185140%2fhow-to-add-to-openldap-user-objectclass%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    這個網誌中的熱門文章

                    Xamarin.form Move up view when keyboard appear

                    Post-Redirect-Get with Spring WebFlux and Thymeleaf

                    Anylogic : not able to use stopDelay()