May 162013

I recently ran into an issue configuring HTTP Basic authentication against Active Directory using Apache httpd.  What was happening was that I’d get a 500 Internal Server Error page every time I hit a location that required Basic authentication.  There wasn’t anything useful in the logs, and I started playing around with the configuration (which, I must point out, was correct in a way).  After about two hours of trial I finally figured out the problem — there appears to be some sort of bug either in the OpenLDAP libraries, Apache httpd, or Active Directory itself, when Apache was trying to connect to AD via LDAP.  I found this only appeared when I had my search base configured to be the top-level DN of my Active Directory.  Changing the search base to an OU lower also resolved the problem, but I couldn’t do that because I have users across several OU’s off the top of the DIT.  The solution I came up with was to connect to port 3268, the Global Catalog, rather than the normal port of 389.

Here’s my mod_authnz_ldap configuration settings:

Hope that helps!

Feb 022013

A new version of AuthLDAP has been released and is ready for consumption.  I’ve put in some more error checking and tried to fix some of the bugs around the group membership checking for users.  I’ve also done some major reworking of the configuration options in order to hopefully allow for better interoperability between directories and to add options that can help with search optimization in some cases.

This has been tested against Active Directory, OpenLDAP, and SunOne Directory Server.  You can download the new library from it’s project page.  I hope you find it useful!

Aug 302012

Lately I’ve been spending a lot of time trying to get a useful combination of LDAP + SSL + Kerberos working on various Unix systems (Linux, Solaris, and AIX specifically).  I’ve had excellent results with Kerberos + LDAP and SSL + LDAP, but combining all three on my CentOS and RHEL systems had me running repeatedly into this error:

I first saw this when I configured my systems to authenticate against Active Directory with SSSD and then I started noticing it with the OpenLDAP clients (ldapadd, ldapmodify, et al) when I began doing more and more work using SASL/GSSAPI authentication. Continue reading »

Jul 182012

It’s been a while since I left you with my last pearl of wisdom.  A couple months ago, I presented a couple methods for authenticating to Active Directory using winbind and for authenticating using the LDAP interface.  In more recent versions of CentOS and RHEL, there is a new method for retriving user information and authenticating – SSS, the System Security Service, which runs as sssd.  SSS was devised by Red Hat as a replacement for the various nss and PAM modules and it seems like they did a halfway decent job with it.

SSS acts as a replacement for the various PADL, Samba winbind, and other ldap and AD based pam and nss modules.  In addition to consolidating several nss and authentication types, there are a couple other advantages, including one unified configuration file and offline authentication, as well as access control.

Continue reading »

Dec 302011

A while back, I described a method for authenticating CentOS and RHEL servers to Active Directory using LDAP.  While this approach is easy to set up and works right out of the gate, there are a few drawbacks to it that I’ve run across:

  • Changing passwords from the Linux server does not work unless you set up LDAP over TLS/SSL, which I’ve found very difficult (though not impossible!) to accomplish
  • While changing the passwords does work, it can be very user unfriendly.  In particular error messages given are very cryptic to the lay user.  Unless you are in IT, you’re not going to know or care about the LDAP error codes that are reported back, nor are you going to want to research what the appropriate character classes are for the AD passwords so that you can choose from at least three of them appropriately.

In this article, I’ll describe how to use winbind to join your Linux server to a Microsoft Active Directory and become a domain member.

Continue reading »

Sep 212011

For the past few weeks, I’ve been spinning my wheels trying to get CentOS 6 to use Active Directory (Windows 2008 R2-based) for user information and authentication. I currently am using LDAP for these purposes, but in the interest of moving towards a more centralized environment am working towards having all of the UNIX and Linux hosts use AD as a central repository for user information and authentication. This is can be done relatively easily and can be done a couple of different ways that I will outline for you here.

Continue reading »