Configuring on RHEL5/CentOS5/Fedora7 using authconfig
As root run authconfig --test. It will display current settings for both nss_ldap and pam_ldap. In most cases the following command will do the job (although some manual editing will still be needed):
authconfig --enableldap --enableldapauth --disablenis --enablecache \
--ldapserver=gregzimbra1.zimbra.com --ldapbasedn=dc=gregzimbra1,dc=zimbra,dc=com \
--updateall
The last parameter will update /etc/ldap.conf, /etc/nsswitch.conf and /etc/pam.d/system-auth configuration files. The only file which requires manual editing is /etc/ldap.conf.
The base line should be already there. It is inserted by authconfig. You should also see a uri line with the address of your ldap server. The host, binddn, bindpw, rootbinddn lines should be added as explained above and /etc/ldap.secret file should exist and contain a password.
The issue with a single /etc/ldap.conf configuration file for both nss_ldap and pam_ldap is that host and uri can work together in Zimbra-specific configuration only if we also add bind_policy soft option. The modified /etc/ldap.conf should look like this:
base dc=gregzimbra1,dc=zimbra,dc=com
host gregzimbra1.zimbra.com
# binddn uid=zimbra,cn=admins,cn=zimbra (pre 5.x)
binddn cn=config
bindpw test123
rootbinddn uid=zimbra,cn=admins,cn=zimbra
uri ldap://gregzimbra1.zimbra.com
bind_policy soft
nss_base_passwd ou=people,dc=gregzimbra1,dc=zimbra,dc=com?one
nss_base_shadow ou=people,dc=gregzimbra1,dc=zimbra,dc=com?one
# Replace the lines above with
# nss_base_passwd dc=gregzimbra1,dc=zimbra,dc=com?sub
# nss_base_shadow dc=gregzimbra1,dc=zimbra,dc=com?sub
# if you want to store windows computers account in LDAP
nss_base_group ou=groups,dc=gregzimbra1,dc=zimbra,dc=com?one
nss_base_hosts ou=machines,dc=gregzimbra1,dc=zimbra,dc=com?one