免费注册 查看新帖 |

Chinaunix

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

[ldap] Invalid DN syntax (34)错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-06 17:07 |只看该作者 |倒序浏览
刚刚接触LDAP。用的是SUSE10.1自带的LDAP。

源文件:
  1. #
  2. # See slapd.conf(5) for details on configuration options.
  3. # This file should NOT be world readable.
  4. #
  5. include                /etc/openldap/schema/core.schema
  6. include                /etc/openldap/schema/cosine.schema
  7. include                /etc/openldap/schema/inetorgperson.schema
  8. include                /etc/openldap/schema/rfc2307bis.schema
  9. include                /etc/openldap/schema/yast.schema
  10. # Define global ACLs to disable default read access.

  11. # Do not enable referrals until AFTER you have a working directory
  12. # service AND an understanding of referrals.
  13. #referral        ldap://root.openldap.org

  14. pidfile                /var/run/slapd/slapd.pid
  15. argsfile        /var/run/slapd/slapd.args

  16. # Load dynamic backend modules:
  17. modulepath        /usr/lib/openldap/modules
  18. # moduleload        back_ldap.la
  19. # moduleload        back_meta.la
  20. # moduleload        back_monitor.la
  21. # moduleload        back_perl.la

  22. # Sample security restrictions
  23. #        Require integrity protection (prevent hijacking)
  24. #        Require 112-bit (3DES or better) encryption for updates
  25. #        Require 63-bit encryption for simple bind
  26. # security ssf=1 update_ssf=112 simple_bind=64

  27. # Sample access control policy:
  28. #       Root DSE: allow anyone to read it
  29. #       Subschema (sub)entry DSE: allow anyone to read it
  30. #       Other DSEs:
  31. #               Allow self write access to user password
  32. #               Allow anonymous users to authenticate
  33. #               Allow read access to everything else
  34. #       Directives needed to implement policy:
  35. access to dn.base=""
  36.         by * read

  37. access to dn.base="cn=Subschema"
  38.         by * read

  39. access to attrs=userPassword,userPKCS12
  40.         by self write
  41.         by * auth

  42. access to attrs=shadowLastChange
  43.         by self write
  44.         by * read

  45. access to *
  46.         by * read

  47. # if no access controls are present, the default policy
  48. # allows anyone and everyone to read anything but restricts
  49. # updates to rootdn.  (e.g., "access to * by * read")
  50. #
  51. # rootdn can always read and write EVERYTHING!

  52. #######################################################################
  53. # BDB database definitions
  54. #######################################################################

  55. loglevel 0
  56. TLSCertificateFile /etc/ssl/servercerts/servercert.pem
  57. TLSCACertificatePath /etc/ssl/certs/
  58. TLSCertificateKeyFile /etc/ssl/servercerts/serverkey.pem
  59. database bdb
  60. suffix "dc=site"
  61. rootdn "cn=Administrator,dc=site"
  62. rootpw "{ssha}QCFxfa8jl/QsGh7WBZd0CFP5kGxRS1JKRg=="
  63. directory /var/lib/ldap
  64. checkpoint 1024 5
  65. cachesize 10000
  66. index objectClass,uidNumber,gidNumber eq
  67. index member,mail eq,pres
  68. index cn,displayname,uid,sn,givenname sub,eq,pres
复制代码


liceven-desktop:/etc/openldap # ldapsearch -x -D "cn=Administrator,dc=site" -W
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base <> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1

可是我想自己按照http://bbs.chinaunix.net/thread-924763-1-1.html配置这个文件:
把:
  1. database bdb
  2. suffix "dc=site"
  3. rootdn "cn=Administrator,dc=site"
复制代码


改成:
  1. suffix “o=Acme,c=UK”
  2. rootdn  “cn=admin,o=Acme,c=UK”

复制代码

然后想自己添加:
  1. dn: o=Acme,c=UK
  2. o: Acme
  3. objectClass: top
  4. objectClass: organization
  5. dn: ou=Sales,o=Acme,c=UK
  6. ou: Sales
  7. objectClass: top
  8. objectClass: organizationalUnit
复制代码


可是这样作好像不行。运行:ldapsearch -x -D “cn=admin,o=Acme,c=UK” -W
就出错了:ldap_bind: Invalid DN syntax (34)
        additional info: invalid DN

帮忙,这是怎么回事阿?我该怎么修改阿?
谢谢!

论坛徽章:
0
2 [报告]
发表于 2007-10-06 19:04 |只看该作者
slapcat > /tmp/xxx.ldif 看看里面有东西吗?

论坛徽章:
0
3 [报告]
发表于 2007-10-06 21:11 |只看该作者
xxx.ldif 的内容是:



  1. dn: o=Acme,c=UK
  2. o: Acme
  3. objectClass: top
  4. objectClass: organization

  5. dn: ou=Sales,o=Acme,c=UK
  6. ou: Sales
  7. objectClass: top
  8. objectClass: organizationalUnit
复制代码

[ 本帖最后由 yexin218 于 2007-10-6 21:12 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2007-10-10 12:36 |只看该作者
问题还在啊?

论坛徽章:
0
5 [报告]
发表于 2007-10-11 21:00 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
6 [报告]
发表于 2007-10-11 21:01 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
7 [报告]
发表于 2007-10-25 16:13 |只看该作者
-f 加上啊,还有要有.ldif文件名作为参数

论坛徽章:
0
8 [报告]
发表于 2007-10-26 13:53 |只看该作者
是不是ldif文件的问题,从ms机器到unix上文件的格式会不同
试试:
dos2unix
iconv
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP