OpenLDAP/Authentication

From Secure Computing Wiki
Revision as of 07:45, 22 April 2008 by 74.95.66.25 (Talk)

Jump to: navigation, search

To use OpenLDAP for authentication on FreeBSD, we're going to need to customize our cosine.schema, and install/configure a few additional ports.

First, we need to install the following ports:

  • security/pam_ldap
  • security/pam_mkhomedir
  • net/nss_ldap

Once the above ports are installed, we need to build our ldap.conf file. What's interesting is that Luke H over at Software, Ltd has done, is made his pam_ldap module configuration compatible with OpenLDAP's configuration. The end result is both pieces of software will use /usr/local/etc/ldap.conf. nss_ldap also follows this pattern.

A good ldap.conf file to use is as follows:

host ldap.claimlynx.com
base dc=claimlynx,dc=com
ldap_version 3
ssl start_tls
TLS_CACERT /usr/local/etc/openldap/ca.crt

nss_base_netgroup cn=group,dc=claimlynx,dc=com?one
nss_base_group ou=group,dc=claimlynx,dc=com

pam_check_host_attr yes

The config above has the following effect:

  1. use ldap server at ldap.example.com
  2. use dc=example,dc=com for the search base
  3. connects with ldap version 3 only
  4. issues a start_tls command to encrypt the connection
  5. uses the ca certificate found in /usr/local/etc/openldap/ca.crt to verify the server's certificate
  6. gets group names from cn=group,dc=example,dc=com (finger,pw, directory listings, etc)
  7. gets group names from ou=group,dc=example,dc=com
  8. requires each user who logs in has a host entry for access to login to this host (more on this later)