?

Log in

No account? Create an account
zq-outline-eyes

Zoomq's journal living,,,

Time is unimportant,only life important!

Previous Entry Share Next Entry
Ubuntu 10.04.1 OpenLDAP 初始化
zq-outline-eyes
zoomq
参考: OpenLDAP Server
https://help.ubuntu.com/10.04/serverguide/C/openldap-server.html

当前 OpenLDAP 在 Ubuntu 的配置也基于LDAP 了,没有生成默认的:
/etc/ldap/slapd.conf

开始很没底,顺着文档作一下,一次成功!很爽直!
1. 先导入最常用的几个 scheme
$ sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/core.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=core,cn=schema,cn=config"
ldap_add: Other (e.g., implementation specific) error (80)
additional info: olcAttributeTypes: Duplicate attributeType: "2.5.4.2"

$ sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=cosine,cn=schema,cn=config"

$ sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=nis,cn=schema,cn=config"


$ sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=inetorgperson,cn=schema,cn=config"

2. 用 slappasswd 生成个管理员口令
3. 手工写个 根 .ldif 然后导入
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f
/path/2/my/ldif/backend.ijinshan.com.ldif
4. 然后就有点不一样了,要导入服务器备份的数据,就得:
+-- 关闭LDAP: sudo /etc/init.d/slapd stop
+-- 导入备份: sudo slapadd -l 110128-ldap.ldif
.#################### 100.00% eta none elapsed none fast!
Closing DB...
+-- 启动LDAP: sudo /etc/init.d/slapd start

就可以用Apache Directory Studio 直接连接观察/操作了!

zq_2011-01-28-143643_736x252_scrot.png

Tags: , ,

  • 1
The friendship is content possible, not requiring due.

  • 1