I am trying to get LDAP working on my mail server for both user authentication and addressbook purposes. I have tried the tutorials on both http://www.server-world.info/en/note?os=CentOS_7&p=openldap&f=1 and http://albanianwizard.org/ubuntu-10-0-4-lucid-lynx-ldap-configuration-the-working-how-to.albanianwizard (The second one is for Ubuntu, but claimed to be a complete and working demo) However, when I try to last part of each of these tutorials I get the following. ldapadd -x -D cn=admin,dc=ringways,dc=com -W -f /tmp/dit.ldif Enter LDAP Password: ldap_bind: Invalid credentials (49) Note: in the server-world one I tried using "dc=ringways,dc=com" as well as leaving it as "dc=server,dc=world" but it didn't seem to make any difference. After each attempt I reset everything using the following script. [root at ollie2 ~]# cat reset_ldap.sh #!/bin/bash -x systemctl stop slapd rpm -e openldap-servers openldap-clients cd /var/lib rm -Rf ldap cd /etc/openldap/ rm -Rf slapd.d/ yum -y install openldap-servers openldap-clients cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG systemctl start slapd slaptest -F /etc/openldap/slapd.d [root at ollie2 ~]# Do I need to do anything else, as it would appear that there is something I'm missing.
Since posting my first email I have re-generated both the root and Manager passwords and re-run the setup. I no longer get the "Invalid credentials" error so presumably the problem must have been a cut/paste issue. I now get the following error. As I am a total newbie to LDAP and don't really know what's going on, I don't know what I need to do to fix it. [root at ollie2 ~]# ldapadd -x -D cn=Manager,dc=ringways,dc=com -W -f basedomain.ldif Enter LDAP Password: adding new entry "dc=ringways,dc=com" ldap_add: Naming violation (64) additional info: value of single-valued naming attribute 'dc' conflicts with value present in entry [root at ollie2 ~]# cat basedomain.ldif # replace to your own domain name for "dc=***,dc=***" section dn: dc=ringways,dc=com objectClass: top objectClass: dcObject objectclass: organization o: Ringways dc: Server dn: cn=Manager,dc=server,dc=world objectClass: organizationalRole cn: Manager description: Directory Manager dn: ou=People,dc=ringways,dc=com objectClass: organizationalUnit ou: People dn: ou=Group,dc=ringways,dc=com objectClass: organizationalUnit ou: Group [root at ollie2 ~]#
Am 27.11.2015 um 16:53 schrieb Gary Stainburn <gary at ringways.co.uk>:> Since posting my first email I have re-generated both the root and Manager > passwords and re-run the setup. > > I no longer get the "Invalid credentials" error so presumably the problem must > have been a cut/paste issue. > > I now get the following error. As I am a total newbie to LDAP and don't really > know what's going on, I don't know what I need to do to fix it. > > [root at ollie2 ~]# ldapadd -x -D cn=Manager,dc=ringways,dc=com -W -f > basedomain.ldif > Enter LDAP Password: > adding new entry "dc=ringways,dc=com" > ldap_add: Naming violation (64) > additional info: value of single-valued naming attribute 'dc' > conflicts with value present in entry > [root at ollie2 ~]# cat basedomain.ldif > # replace to your own domain name for "dc=***,dc=***" section > > dn: dc=ringways,dc=com > objectClass: top > objectClass: dcObject > objectclass: organization > o: Ringways > dc: Server > > dn: cn=Manager,dc=server,dc=world > objectClass: organizationalRole > cn: Manager > description: Directory Manager > > dn: ou=People,dc=ringways,dc=com > objectClass: organizationalUnit > ou: People > > dn: ou=Group,dc=ringways,dc=com > objectClass: organizationalUnit > ou: Group# systemctl stop slapd # slapadd -v -l this-ldif-file # cat this-ldif-file dn: dc=ringways,dc=com objectClass: dcObject objectclass: organization o: Ringways dc: ringways # systemctl start slapd # ldapadd -x -D cn=Manager,dc=ringways,dc=com -W -f the-rest-of-yourfile -- LF