免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2058 | 回复: 1
打印 上一主题 下一主题

OpenLDAP Master server与Slave server TLS认证问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-01 17:55 |只看该作者 |倒序浏览
现有多台linux服务器,每次为很多服务器一台一台的添加帐号感觉很麻烦,于是就想到用LDAP来做。
搭建测试环境 4台虚拟机 分别为 ldapmaster.example.com  192.168.1.200
                                            ldapslave.example.com 192.168.1.201
                                            ldapclient-a.example.com 192.168.1.202
                                            ldapclient-b.example.com 192.168.1.203
设想如果ldapmaster由于故障不工作,ldapslave会替代ldapmaster工作。

1.主认证服务器ldapmaster上安装软件
openldap-2.3.43-3.el5
openldap-devel-2.3.43-3.el5
openldap-servers-2.3.43-3.el5
nss_ldap-253-22.el5_4
python-ldap-2.2.0-2.1
openldap-clients-2.3.43-3.el5

2.客户机ldapclient-a安装软件
openldap-2.3.43-3.el5
openldap-devel-2.3.43-3.el5
python-ldap-2.2.0-2.1
openldap-clients-2.3.43-3.el5
nss_ldap-253-22.el5_4

3.ldapmaster的配置文件如下/etc/openldap/slapd.conf


############################################
include                /etc/openldap/schema/core.schema
include                /etc/openldap/schema/cosine.schema
include                /etc/openldap/schema/inetorgperson.schema
include                /etc/openldap/schema/nis.schema
pidfile                /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database        bdb
suffix                "dc=example,dc=com"
rootdn                "cn=root,dc=example,dc=com"
rootpw {SSHA}CMqHlrrV5RR9bA5icsi/6/7mJNvfVe4k
directory        /var/lib/ldap

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub

# Replicas of this database
replogfile /var/lib/ldap/openldap-master-replog

replica host=ldapslave.example.com:389
        binddn="cn=root,dc=example,dc=com"
        bindmethod=simple
        credentials=secret
        tls=yes
TLSCipherSuite          HIGH:MEDIUM:+SSLv2:+SSLv3:RSA
TLSCACertificateFile    /etc/openldap/cacerts/server.pem
TLSCertificateFile      /etc/openldap/cacerts/server.pem
TLSCertificateKeyFile   /etc/openldap/cacerts/server.pem
TLSVerifyClient         allow
#########################################

4.ldapslave的配置文件如下/etc/openldap/slapd.conf

##################################################
include                /etc/openldap/schema/core.schema
include                /etc/openldap/schema/cosine.schema
include                /etc/openldap/schema/inetorgperson.schema
include                /etc/openldap/schema/nis.schema
allow bind_v2
pidfile                /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args
#######################################################################
# ldbm and/or bdb database definitions
#######################################################################
database        bdb
suffix                "dc=example,dc=com"
rootdn                "cn=root,dc=example,dc=com"
rootpw {SSHA}CMqHlrrV5RR9bA5icsi/6/7mJNvfVe4k
directory        /var/lib/ldap
index objectClass                       eq,pres
index ou,cn,mail,surname,givenname      eq,pres,sub
index uidNumber,gidNumber,loginShell    eq,pres
index uid,memberUid                     eq,pres,sub
index nisMapName,nisMapEntry            eq,pres,sub
updatedn "cn=root,dc=example,dc=com"
updateref ldap://ldapmaster.example.com:389/
TLSCipherSuite          HIGH:MEDIUM:+SSLv2:+SSLv3:RSA
TLSCACertificateFile    /etc/openldap/cacerts/server.pem
TLSCertificateFile      /etc/openldap/cacerts/server.pem
TLSCertificateKeyFile   /etc/openldap/cacerts/server.pem
TLSVerifyClient         allow
############################################

5.client-a配置文件如下 /etc/openldap/ldap.conf
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

#BASE        dc=example, dc=com
#URI        ldap://ldap.example.com ldap://ldap-master.example.com:666

#SIZELIMIT        12
#TIMELIMIT        15
#DEREF                never
BASE dc=example,dc=com
URI ldaps://ldapmaster.example.com/
TLS_CACERTDIR /etc/openldap/cacerts

现测试,如果未做TLS加密,停掉主服务器,从服务器是可以替代主服务器起认证作用的。如果做了TLS加密,由于创建证书时有域名ldapmaster.example.com的信息,在客户机ldapclient-a去从服务器ldapslave去获取认证时,由于发现证书信息不一致就无法通过认证。
请教实现过相似功能的朋友,在用TLS加密的同时如何去配置ldpamaster以及ldapslave。
以上配置未全部列出。
LDAP以及TLS配置参考于 http://www.linuxhomenetworking.c ... ing_LDAP_and_RADIUS

master slave同步配置参考于 http://Linux.chinaitlab.com/administer/519684_5.html

论坛徽章:
0
2 [报告]
发表于 2009-12-02 18:05 |只看该作者
有没有单独给Master 和 Slave 这个机器单独颁发证书?

还有注意时间。作证书相关一般要ntp跟上,否则时间不一致基本都是会出问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP