Getting a "Can't contact LDAP server" when trying to add an ldif file
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First make sure slapd is running and it's listening on the default port:
Code:
ps -ef|grep slapd
netstat -an|grep 389
If not, then check the system logs to see if you find the reason.
If everything is ok, then perhaps it's a SELinux problem, a firewall preventing connections, or something like that.
Try the more verbose command
Make sure that the binddn (uid=root,dc=ldap-gln,dc=mysite,dc=com" is the same as the rootdn defined in slapd.conf.
You can also stop slapd and use slapadd instead of ldapadd to add the ldif.
First make sure slapd is running and it's listening on the default port:
Code:
ps -ef|grep slapd
netstat -an|grep 389
If not, then check the system logs to see if you find the reason.
If everything is ok, then perhaps it's a SELinux problem, a firewall preventing connections, or something like that.
Try the more verbose command
Make sure that the binddn (uid=root,dc=ldap-gln,dc=mysite,dc=com" is the same as the rootdn defined in slapd.conf.
You can also stop slapd and use slapadd instead of ldapadd to add the ldif.
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/samba.schema
allow bind_v2
pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
database bdb
suffix "dc=ldap-gln,dc=mysite,dc=com"
rootdn "uid=root,dc=ldap-gln,dc=mysite,dc=com"
rootpw {SSHA}vEmhoewI7wNUjjzpeg1Ys51cWfIqY+rO
directory /var/lib/ldap
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
index uidNumber,gidNumber,loginShell eq,pres
index uid,memberUid eq,pres,sub
index nisMapName,nisMapEntry eq,pres,sub
Here is my ldap.conf file
Code:
URI ldap://127.0.0.1/
HOST ldap-gln.mysite.com
BASE dc=ldap-gln,dc=mysite,dc=com
TLS_CACERTDIR /etc/openldap/cacerts
I disabled SELinux and the Firewall...The URI entry I added and I tired the same command again.. now I am getting this error...
Code:
[root@aardvark:~<24>]# /usr/bin/ldapadd -x -D 'uid=root,dc=ldap-gln,dc=mysite,dc=com' -W -f /tmp/4over.ldif
Enter LDAP Password:
adding new entry "dc=ldap-gln,dc=mysite,dc=com"
ldap_add: Naming violation (64)
additional info: value of naming attribute 'dc' is not present in entry
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.