Chinaunix首页 | 论坛 | 博客
  • 博客访问: 656632
  • 博文数量: 121
  • 博客积分: 1425
  • 博客等级: 中尉
  • 技术积分: 2059
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-03 15:34
文章分类

全部博文(121)

文章存档

2018年(1)

2017年(2)

2016年(1)

2015年(11)

2014年(14)

2013年(47)

2012年(45)

分类: IT职场

2015-12-02 13:00:02

find / -name openldap*
yum install  openldap openldap-servers openldap-clients
[root@localhost openldap]# ls -al /usr/share/openldap-servers/
总用量 12
drwxr-xr-x.  2 root root   47 11月 27 10:58 .
drwxr-xr-x. 74 root root 4096 11月 27 10:58 ..
-rw-r--r--.  1 root root  845 9月  29 21:31 DB_CONFIG.example
-rw-r--r--.  1 root root 3717 9月  29 21:31 slapd.ldif




[root@localhost openldap]# pwd
/etc/openldap
[root@localhost openldap]# ls
cacerts  certs  check_password.conf  ldap.conf  schema  slapd.d


[root@localhost openldap]# cp /usr/share/openldap-servers/slapd.ldif /etc/openldap/slapd.conf
[root@localhost openldap]# ls
cacerts  certs  check_password.conf  ldap.conf  schema  slapd.conf  slapd.d


[root@localhost openldap]# cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

这个时候需要重新启动操作系统  也是必须重新启动 
 
[root@localhost ldap]# service slapd start  启动服务
修改389这个端口
[root@localhost ldap]# slapd -f /etc/openldap/slapd.conf -h ldap://3891

创建超级管理员的密码
[root@localhost ldap]# slappasswd -h {SSHA}
New password: 
Re-enter new password: 
{SSHA}F3CdPHlDGMetltlxoXEg4MD9pZoZe9mH


[root@lcywx openldap]# vim slapd.d/cn\=config/olcDatabase={2}hdb.ldif

olcSuffix: dc=example,dc=com
#olcSuffix: dc=my-domain,dc=com
olcRootDN: cn=Manager,dc=example,dc=com
#olcRootDN: cn=Manager,dc=my-domain,dc=com
olcrootpw:      {SSHA}F3CdPHlDGMetltlxoXEg4MD9pZoZe9mH
loglevel 296


                                                                                          
[root@lcywx openldap]# vim slapd.d/cn\=config/olcDatabase={1}monitor.ldif
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external
 ,cn=auth" read by dn.base="cn=Manager,dc=example,dc=com" read by * none

[root@lcywx openldap]# more ldap.ldif 
dn:dc=example,dc=com
objectclass:dcObject
objectclass:organization
o:Example, Inc.
dc:example


dn:cn=Manager,dc=example,dc=com
objectclass:organizationalRole
cn:Manager
-----------------------------------------------------------------------------------------------------

[root@localhost ldap]# vi  /etc/rsyslog.conf
local4.* /var/log/ldap.log


[root@localhost ldap]# service rsyslog restart


启动服务
[root@lcywx openldap]# service slapd start

加载导入数据
[root@lcywx openldap]# /usr/bin/ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f ldap.ldif    

输入密码  没有报错误就加载成功了

然后就是到客户端了



阅读(1689) | 评论(0) | 转发(0) |
0

上一篇:sysbeanch 操作记录

下一篇:centos 6 install LDAP

给主人留下些什么吧!~~