没有Kerberos的MAC OS X上的OpenLDAP和SVN

时间:2016-03-18 15:37:11

标签: apache svn kerberos openldap

我都是! 我有一个 SVN服务器(在MAC OS X Captain上运行)。我还配置了 OpenLDAP,,这样当用户使用userName和Password访问SVN服务器时,他们会在成功时访问SVN存储库(w.r.t openLDAP数据库条目)。

但是,当用户尝试登录SVN认证失败时。我在调试模式下运行sldap来弄清楚出了什么问题。我发现用户和传递匹配LDAP数据库条目。但是,我还发现它尝试使用Kerberos对用户进行身份验证。我只想要SVN& LDAP。任何人都知道如何禁用尝试进行身份验证的Kerberos?
提前致谢! 莱蒂西亚

httpd.config snipped(apache 2.4):

<Location /svn/Thesis>
DAV svn
SVNPath /var/svn/repositories/Thesis
AuthType Basic
AuthName "Repository"
AuthBasicProvider ldap
AuthLDAPBindDN "cn=Manager,dc=company,dc=org"
AuthLDAPBindPassword pasword1
AuthLDAPURL ldap://158.227.115.33:389/dc=company,dc=org?cn?sub?(objectclass=*)
Require ldap-group cn=ActiveMember,ou=Groups,o=company,dc=company,dc=org
</Location>

Slap.conf

include         /private/etc/openldap/schema/core.schema
include         /private/etc/openldap/schema/cosine.schema
include         /private/etc/openldap/schema/inetorgperson.schema
include         /private/etc/openldap/schema/nis.schema
include         /private/etc/openldap/schema/samba.schema

modulepath      /usr/libexec/openldap
moduleload      back_bdb.la

# rootdn can always read and write EVERYTHING!
access to dn.subtree="o=company,dc=company,dc=org"
    by dn.base="cn=Manager,dc=company,dc=org" write
    by self write
    by users read
    by anonymous auth
access to *
by self write
    by users read
    by anonymous auth

database        bdb
suffix          "dc=company,dc=org"
rootdn          "cn=Manager,dc=company,dc=org"
rootpw          {SSHA}dr/1Yu+mRLm6PAHtp+UMqJuJMlMMTFQd
directory       /private/var/db/openldap/openldap-data

# 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

Ldap.conf

URI ldap://127.0.0.1/
BASE dc=company,dc=org

#SIZELIMIT  12
#TIMELIMIT  15
#DEREF      never
TLS_REQCERT demand

用户尝试登录SVN时记录(运行slapd -d 255)

………
56ec1897 do_bind: version=3 dn="cn=John,ou=Members,o=company,dc=company,dc=org" method=128
56ec1897 ==> bdb_bind: dn: cn=John,ou=Members,o=company,dc=company,dc=org
56ec1897 bdb_dn2entry("cn=John,ou=members,o=company,dc=company,dc=org")
56ec1897 => bdb_search
56ec1897 bdb_dn2entry("cn=kerberoskdc,cn=config,dc=company,dc=org")
56ec1897 => bdb_dn2id("cn=config,dc=company,dc=org")
56ec1897 <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
56ec1897 => access_allowed: disclose access to "dc=company,dc=org" "entry" requested
56ec1897 => dn: [1] o=company,dc=company,dc=org
56ec1897 => acl_get: [2] attr entry
56ec1897 => acl_mask: access to entry "dc=company,dc=org", attr "entry" requested
56ec1897 => acl_mask: to all values by "cn=kerberoskdc,cn=config,dc=company,dc=org", (=0) 
56ec1897 <= check a_dn_pat: self
56ec1897 <= check a_dn_pat: users
56ec1897 <= acl_mask: [2] applying read(=rscxd) (stop)
56ec1897 <= acl_mask: [2] mask: read(=rscxd)
56ec1897 => slap_access_allowed: disclose access granted by read(=rscxd)
56ec1897 => access_allowed: disclose access granted by read(=rscxd)
56ec1897 send_ldap_result: conn=-1 op=0 p=0
56ec1897 send_ldap_result: err=10 matched="dc=company,dc=org" text=""
56ec1897 Entry *odusers_copy_entry(Operation *): Unable to locate    cn=kerberoskdc,cn=config,dc=company,dc=org (32)
56ec1897 odusers_copy_krbrealm: No entry associated with KerberosKDC cn=kerberoskdc,cn=config,dc=company,dc=org
56ec1897 odusers_krb_auth: could not retrieve krb realm while authing John
56ec1897 send_ldap_result: conn=1000 op=2 p=3
56ec1897 send_ldap_result: err=50 matched="" text=""
56ec1897 send_ldap_response: msgid=3 tag=97 err=50
…….    

1 个答案:

答案 0 :(得分:3)

我终于解决了!

显然,如果LDAP后端是bdb,则会自动调用Kerberos(不确切知道如何/为什么)。但是,当我将其更改为ldif时,没有任何Kerberos调用,一切都按预期工作。我执行的步骤如下:

  1. 使用Apache目录Studio LDAP浏览器,我将DIT导出到ldif文件。
  2. 我停止了slapd,并将“database bdb”行更改为“database ldif”(在slap.conf中)。我还删除了db目录中的所有文件,但DATABASE_CONFIG除外。
  3. 我开始使用slapd,再次使用Apache目录工作室导入了之前创建的ldif文件(步骤1)。
  4. voilà: - )