OpenLDAP 配置错误 ldap_bind:凭据无效 (49)

发布于 2024-09-19 21:35:57 字数 1405 浏览 8 评论 0原文

我正在使用 Ubuntu 10.4 服务器,并且尝试将 OpenLDAP 配置为 SVN 和其他服务的身份验证协议。但是我完全不明白 ldap 是如何工作的,在设置示例配置后我尝试填充它但没有成功。这是错误:

ldap_bind: Invalid credentials (49)

这似乎是示例配置问题,更准确地说是管理配置问题。但是我尝试使用加密密码更改它,但没有结果。代码配置如下

    # Load modules for database type
    dn: cn=module,cn=config
    objectclass: olcModuleList
    cn: module
    olcModuleLoad: back_bdb.la

    # Create directory database
    dn: olcDatabase=bdb,cn=config
    objectClass: olcDatabaseConfig
    objectClass: olcBdbConfig
    olcDatabase: bdb

   # Domain name (e.g. home.local)
   olcSuffix: dc=home,dc=local

   # Location on system where database is stored
   olcDbDirectory: /var/lib/ldap

   # Manager of the database
   olcRootDN: cn=admin,dc=home,dc=local
   olcRootPW: admin

   # Indices in database to speed up searches
   olcDbIndex: uid pres,eq
   olcDbIndex: cn,sn,mail pres,eq,approx,sub
   olcDbIndex: objectClass eq

   # Allow users to change their own password
   # Allow anonymous to authenciate against the password
   # Allow admin to change anyone's password
   olcAccess: to attrs=userPassword
   by self write
   by anonymous auth
   by dn.base="cn=admin,dc=home,dc=local" write
   by * none

   # Allow users to change their own record
   # Allow anyone to read directory
   olcAccess: to *
   by self write
   by dn.base="cn=admin,dc=home,dc=local" write
   by * read

I'm using Ubuntu 10.4 server and I'm trying to configure OpenLDAP as a protocol for authentication for SVN and other services. However I quite don't understand how ldap works and after setting a example config I tried to populate it without success. This is the error:

ldap_bind: Invalid credentials (49)

It seems to be example config problem, more precisely with the admin configuration. However I tried to change it using cryptographic password but got no results. Code config bellow

    # Load modules for database type
    dn: cn=module,cn=config
    objectclass: olcModuleList
    cn: module
    olcModuleLoad: back_bdb.la

    # Create directory database
    dn: olcDatabase=bdb,cn=config
    objectClass: olcDatabaseConfig
    objectClass: olcBdbConfig
    olcDatabase: bdb

   # Domain name (e.g. home.local)
   olcSuffix: dc=home,dc=local

   # Location on system where database is stored
   olcDbDirectory: /var/lib/ldap

   # Manager of the database
   olcRootDN: cn=admin,dc=home,dc=local
   olcRootPW: admin

   # Indices in database to speed up searches
   olcDbIndex: uid pres,eq
   olcDbIndex: cn,sn,mail pres,eq,approx,sub
   olcDbIndex: objectClass eq

   # Allow users to change their own password
   # Allow anonymous to authenciate against the password
   # Allow admin to change anyone's password
   olcAccess: to attrs=userPassword
   by self write
   by anonymous auth
   by dn.base="cn=admin,dc=home,dc=local" write
   by * none

   # Allow users to change their own record
   # Allow anyone to read directory
   olcAccess: to *
   by self write
   by dn.base="cn=admin,dc=home,dc=local" write
   by * read

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你对谁都笑 2024-09-26 21:35:57

您是否尝试过通过 CLI 进行连接?

ldapsearch -x -D "cn=admin,dc=home,dc=local" -W -h <hostname>

请检查您的系统日志,默认情况下 slapd 会在那里记录其输出。

您还可以使用 slapcat(必须在本地执行)来了解数据库是否已创建(否则 slapd 无论如何都会中断)。它将输出第一个可用的数据库。使用标志 -n 提取特定数据库:

slapcat -n <database number>

我敢打赌,您正在针对错误的数据库进行身份验证。

Have you tried to connect via CLI?

ldapsearch -x -D "cn=admin,dc=home,dc=local" -W -h <hostname>

Do check your syslog, slapd by default logs its output there.

You can also use slapcat, which must be executed locally, to know whether your database was created or not (slapd would break if otherwise, anyway). It will output the first database avaliable. Use the flag -n to extract an specific database:

slapcat -n <database number>

My bets are that you're authenticating against the wrong database.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文