r/openldap•
tmixlogs

LDAP 101: Server / Client setup with automount user home directories

The goal: A simple Openldap server that a client can connect to and mount user home directories on a test domain (example.com). The goal is to start out with simple bind and then eventually get TLS working.

I have started with this process as an initial guide

Continued troubleshooting from r/linuxadmin: http://www.reddit.com/r/linuxadmin/comments/1xfvu9/ldap_serverclient_with_automount_user_home/

Posted Feb 10, 2014, 12:08 PM UTC

424
tmixlogsOP•

Simple bind from the server:

[root@ldap1 ~]# ldapsearch -x -H ldap://127.0.0.1 -b 'dc=example,dc=com' '(uid=test)'
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (uid=test)
# requesting: ALL
#

# search result
search: 2
result: 0 Success

# numResponses: 1

Simple bind from the client:

# ldapsearch -x -b 'dc=example,dc=com' '(uid=test)'
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
1
BasementTrix•

Ok, problem #1. On the client system, you haven't specified an LDAP server. On most systems, if you install LDAP client packages, /etc/ldap.conf (or /etc/openldap/ldap.conf, depending on system) will either contain no host or point to localhost -- which obviously isn't correct in this instance.

On the client system, try adding "-H ldap://(server name/address here)/" between the "-x" and "-b" options of your ldapsearch line.

2
tmixlogsOP•

I got the original command working it was a networking issue. (Firewall). Now the output from the command on the client matches what I get on the server side.

1
BasementTrix•

Ok, it looks like you have an object at "uid=test,dc=example,dc=com", but it doesn't appear to have any attributes.

Any chance you could post your slapcat(8) output? Just in case, remember to grep out '^userPassword'. No need to show your hashes in public. :-)

2
tmixlogsOP•

The output is huge because the script in that guide imports every user on the system. Here is the relevant part I think:

dn: cn=test,ou=Group,dc=example,dc=com
objectClass: posixGroup
objectClass: top
cn: test
userPassword:: <nope>
gidNumber: 501
structuralObjectClass: posixGroup
entryUUID: 52f451ae-2547-1033-8ce1-8779d5168401
creatorsName: cn=root,dc=example,dc=com
createTimestamp: 20140208195955Z
entryCSN: 20140208195955.189190Z#000000#000#000000
modifiersName: cn=root,dc=example,dc=com
modifyTimestamp: 20140208195955Z
1