OpenLDAP安装及配置

1.安装

1.1 查看

# yum list | grep openldap

1.2 安装

# yum install openldap*

 

2.配置

2.1 创建slapd.config配置文件

# cp /usr/share/openldap-servers/slapd.conf.obsolete /etc/openldap/slapd.conf

2.2 修改密码

# slappasswd 
New password: secret
Re-enter new password: secret
{SSHA}Hy/MUWmZlIXWawK6uZxWprMU0FErCLnU

 2.3 修改slapd.config文件

# vi /etc/openldap/slapd.conf

       修改dc和rootpw,如下:

改前:

database        bdb
suffix          "dc=my-domain,dc=com"
checkpoint      1024 15
rootdn          "cn=Manager,dc=my-domain,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw                secret
# rootpw                {crypt}ijFYNcSNctBYg

 

改后:

database        bdb
suffix          "dc=my-domain,dc=com"
checkpoint      1024 15
rootdn          "cn=Manager,dc=my-domain,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# rootpw                secret
rootpw                {SSHA}Hy/MUWmZlIXWawK6uZxWprMU0FErCLnU

 2.4 重新生成/etc/openldap/slapd.d目录

# rm -rf slapd.d/*

 

# slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
bdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).
Expect poor performance for suffix "dc=my-domain,dc=com".
bdb_db_open: database "dc=my-domain,dc=com": db_open(/var/lib/ldap/id2entry.bdb) failed: No such file or directory (2).
backend_startup_one (type=bdb, suffix="dc=my-domain,dc=com"): bi_db_open failed! (2)
slap_startup failed (test would succeed using the -u switch)

 2.5 修改/etc/openldap/slapd.d/目录权限

# chown ldap:ldap -R /etc/openldap/slapd.d

 2.6 修改/var/lib/ldap/目录权限

# chown ldap:ldap -R /var/lib/ldap/

 

3. 启动slapd服务

# /etc/init.d/slapd start
ln: creating hard link `/var/run/slapd.pid': File exists   [  OK  ]

 

# telnet localhost 389
Trying ::1...
Connected to localhost.
Escape character is '^]'.

 

# ldapsearch -x
# extended LDIF
#
# LDAPv3
# base <> (default) with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

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

 

 未完待续...
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值