加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

大数据:openldap 初始化配置文件报错信息

(2014-06-13 17:49:03)
错误描述:
[root@AY140516110421750f8eZ bin]# ./ldapadd -x  -D "cn=Manager,dc=example,dc=com" -w secret -f init.ldif 
ldapadd: attributeDescription "dn": (possible missing newline after line 7, entry "dc=example,dc=com"?)
adding new entry "dc=example,dc=com"
ldap_add: Undefined attribute type (17)
        additional info: dn: attribute type undefined

解决方法:

1.遇见的两个错误及其原因

ldap_add: Invalid syntax (21)

 additional info: objectclass: value #0 invalid per syntax

原因:ldif文件中存在空格

ldap_add: Undefined attribute type (17)

 additional info: dn: attribute type undefined

原因:should put an empty line in the ldif file between two entries

2.正确书写格式: 

(1空行)

dn:(空格) dc=mail,dc=kaspersky,dc=com(结尾无空格)

objectclass: (空格)dcObject(结尾无空格)

objectclass: (空格)organization(结尾无空格)

o: (空格)kaspersky(结尾无空格)

dc:(空格) test(结尾无空格)

(1空行)

dn: (空格)cn=test,dc=mail,dc=kaspersky,dc=com(结尾无空格)

objectclass: (空格)organizationalRole(结尾无空格)

cn: (空格)test(结尾无空格)

(结尾无空行)


[root@AY140516110421750f8eZ bin]# cat -A init.ldif 
dn: dc=example,dc=com$
objectClass: dcObject$
objectClass: organization$
dc: example$
o: Example Company$
 $
dn: cn=Manager,dc=example,dc=com$
objectClass: organizationalRole$
objectClass: top$
cn: Manager$
$
dn: ou=it,dc=example,dc=com$
objectClass: top$
objectClass: organizationalUnit$
ou: it$
$
dn: ou=hr,dc=example,dc=com$
objectClass: top$
objectClass: organizationalUnit$
ou: it$

看到空行前的空格了吧?删掉就可以了!!!

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有