现在试试安装 LDAP (openLDAP)。
1. 软件安装:
yum -y install openldap openldap-clients openldap-servers nss_ldap samba samba-client openssl mod_ssl php-ldap php-pdo php-cli php-common perl-LDAP smbldap-tools perl-Digest-SHA1 perl-Digest-SHA perl-Unicode-String perl-Unicode-Map8 perl-Unicode-Map perl-Unicode-MapUTF8 perl-Jcode
yum -y install openldap openldap-clients openldap-servers nss_ldap samba samba-client openssl mod_ssl php-ldap php-pdo php-cli php-common perl-LDAP smbldap-tools perl-Digest-SHA1 perl-Digest-SHA perl-Unicode-String perl-Unicode-Map8 perl-Unicode-Map perl-Unicode-MapUTF8 perl-Jcode
# cp /etc/ldap.conf /etc/ldap.conf.orig
# cp /etc/nsswitch.conf /etc/nsswitch.conf.orig
# cp -R /etc/openldap /etc/openldap.orig
# cp /etc/ldap.conf /etc/ldap.conf.orig # cp /etc/nsswitch.conf /etc/nsswitch.conf.orig # cp -R /etc/openldap /etc/openldap.orig
#/usr/sbin/slappasswd
#/usr/sbin/slappasswd
# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# chown -R ldap:ldap /var/lib/ldap
# chmod 700 /var/lib/ldap
# chown -R ldap:ldap /var/lib/ldap # chmod 700 /var/lib/ldap
# chkconfig --levels 235 ldap on
# chkconfig --levels 235 ldap on
/etc/init.d/ldap start
/etc/init.d/ldap start
dn: dc=example,dc=com
dc: example
o: example.com
description: Root LDAP entry for example.com
objectClass: top
objectClass: dcObject
objectClass: organization
dn: dc=example,dc=com dc: example o: example.com description: Root LDAP entry for example.com objectClass: top objectClass: dcObject objectClass: organization
dn: ou=People,dc=example,dc=com
ou: People
objectClass: organizationalUnit
dn: ou=Groups,dc=example,dc=com
ou: Groups
objectClass: organizationalUnit
dn: ou=Hosts,dc=example,dc=com
ou: Hosts
description: All hosts in example.com
objectClass: organizationalUnit
dn: ou=People,dc=example,dc=com ou: People objectClass: organizationalUnit dn: ou=Groups,dc=example,dc=com ou: Groups objectClass: organizationalUnit dn: ou=Hosts,dc=example,dc=com ou: Hosts description: All hosts in example.com objectClass: organizationalUnit
# mkdir /home/tmp
# mkdir /home/tmp
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /home/tmp/rootinit.ldif
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /home/tmp/ou1.ldif
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /home/tmp/rootinit.ldif # ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /home/tmp/ou1.ldif
# ldapsearch -x -b 'dc=example,dc=com'
# ldapsearch -x -b 'dc=example,dc=com'
# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# yum -y install phpldapadmin
# yum -y install phpldapadmin
# /etc/init.d/httpd restart
# /etc/init.d/httpd restart
rootdn "cn=root,dc=example,dc=com"
rootdn "cn=root,dc=example,dc=com"
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /home/tmp/init1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /home/tmp/init1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /homr/tmp/ou1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /homr/tmp/ou1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /home/tmp/wgroup1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /home/tmp/wgroup1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /home/tmp/user1.ldif
# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f /home/tmp/user1.ldif
# ldapsearch -x -b "dc=example,dc=com"
# ldapsearch -x -b "dc=example,dc=com"
# ldappasswd -x -D "cn=root,dc=example,dc=com" -W "uid=John,ou=People,dc=example,dc=com" -S
New password:
Re-enter new password:
Enter LDAP Password:
# ldappasswd -x -D "cn=root,dc=example,dc=com" -W "uid=John,ou=People,dc=example,dc=com" -S New password: Re-enter new password: Enter LDAP Password:
# ldappasswd -x -D "cn=root,dc=example,dc=com" -W "uid=ldapadmin,ou=People,dc=example,dc=com" -S
New password:
Re-enter new password:
Enter LDAP Password:
# ldappasswd -x -D "cn=root,dc=example,dc=com" -W "uid=ldapadmin,ou=People,dc=example,dc=com" -S New password: Re-enter new password: Enter LDAP Password:
http://blog.javachap.com/index.php/installing-openldap-on-centos/
http://blog.javachap.com/index.php/installing-openldap-on-centos/
http://www.syntaxtechnology.com/2010/05/openldap-on-centos-5-4-part-4-the-data/
http://www.syntaxtechnology.com/2010/05/openldap-on-centos-5-4-part-4-the-data/
http://www.howtoforge.com/ldap-user-authentication-on-centos-5.x
http://www.howtoforge.com/ldap-user-authentication-on-centos-5.x
http://www.productionmonkeys.net/guides/ldap-server/openldap-installation
http://www.productionmonkeys.net/guides/ldap-server/openldap-installation
http://www.syntaxtechnology.com/2010/05/openldap-on-centos-5-4-part-4-the-data/
http://www.syntaxtechnology.com/2010/05/openldap-on-centos-5-4-part-4-the-data/
http://www.server-world.info/en/note?os=CentOS_5&p=ldap
http://www.server-world.info/en/note?os=CentOS_5&p=ldap
http://zhumeng8337797.blog.163.com/blog/#m=0
http://zhumeng8337797.blog.163.com/blog/#m=0
转载自:http://kingsz1.iteye.com/blog/842406