Centralized authentication under Linux shouldn’t be so difficult. Looking at the directory options, your choices basically boil down to Network Information Service (NIS), Network Information Service Plus (NIS+), MIT Kerberos, or Lightweight Directory Access Protocol (LDAP).
In this set of notes, I use OpenLDAP as the mechanism for centralized authentication, namely, because it has a lot of industry support, including products such as Novell eDirectory, Microsoft Active Directory, and IBM RADIUS, all of which implement LDAP as the backend to their authentication systems.
More importantly, Linux users who wish to authenticate via Microsoft Active Directory can actually do so, thanks to Microsoft Services for UNIX. Reciprocally, Microsoft Windows workstations can centrally authenticate to a Linux primary domain controller through Samba. Of course, configuration becomes more difficult as complexity increases.
In my work, I only have to worry about Linux machines. And in my case, the domain controller is running CentOS, while my clients are all Linux boxes running Debian, Fedora, Red Hat Enterprise Linux, and SuSE. Variety is the spice of life, but more often than not, it’s the clients decision and we just go with it.
The good news is that there’s a ton of documentation out there for completing such a setup. The bad news is that none of them are entirely correct. Thus, my personal set of notes.
The first step is to install the OpenLDAP server on the domain controller, and install the OpenLDAP clients on the clients. In CentOS, this is simply:
yum install openldap-servers
yum install openldap-clients
Next, complete the chapter on Lightweight Directory Access Protocol. Caveat: during migrate_all_online.sh, credentials is just a fancy word for password. Also, the migrate scripts may not work. If this is the case, you must comment out some of the imports until you find the one that is causing the error:
slapadd: could not parse entry (line=71)
Worse, there seems to be no standardized mechanism for adding and deleting users after the initial import.
After completion:
chown -R ldap /var/lib/ldap
You may also want home directories to be automatically created on login if they do not exist. To do so, add:
session required pam_mkhomedir.so skel=/etc/skel umask=0022
to the relevant /etc/pam.d files.
Debugging
The LDAP Browser/Editor is essential in debugging the LDAP configuration. For the login, be sure that you use the full rootdn string, that is:
cn=manager,dc=objectwareinc,dc=net
The LDAP browser will provide read/write access to the LDAP directory.
Resources