Centos7 搭建openldap

本文详细介绍了如何在Centos7系统中搭建openldap,包括关闭selinux和防火墙、安装openldap、配置openldap、解决配置过程中的问题,以及安装和使用web界面phpldapadmin进行管理。通过这些步骤,创建了一个包含管理域和多个组织单元的LDAP目录树。
摘要由CSDN通过智能技术生成

本次实验参考链接:

https://blog.csdn.net/weixin_41004350/article/details/89521170?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-1

https://blog.csdn.net/u013577413/article/details/105193881

https://blog.csdn.net/zhoushengtao12/article/details/95346903

https://blog.csdn.net/a_drjiaoda/article/details/89674468

https://blog.csdn.net/ytangdigl/article/details/79796961

https://blog.csdn.net/weixin_34143774/article/details/92851789

万分感谢🙏

Centos7 搭建openldap

本次实验环境:

[root@myc-test ~]# lsb_release -a
LSB Version:  :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:  CentOS Linux release 7.7.1908 (Core)
Release:  7.7.1908
Codename: Core
[root@myc-test ~]#  slapd -VV
@(#) $OpenLDAP: slapd 2.4.44 (Jan 29 2019 17:42:45) $
  mockbuild@x86-01.bsys.centos.org:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
[root@myc-test ~]# rpm -qa | grep phpldapadmin
phpldapadmin-1.2.3-10.el7.noarch
[root@myc-test ~]# php -v
PHP 5.4.16 (cli) (built: Nov  1 2019 16:04:20) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

开始正式搭建

  1. 关闭selinux和防火墙

[root@myc-test ~]# getenforce
Enforcing
[root@myc-test ~]# setenforce 0
[root@myc-test ~]# getenforce
Permissive
[root@myc-test ~]# firewall-cmd --state
running
[root@myc-test ~]# systemctl stop firewalld.service
[root@myc-test ~]# systemctl disable firewalld.service 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@myc-test ~]# firewall-cmd --state
not running

更新系统时间

[root@myc-test ~]# yum -y install ntp ntpdate
[root@myc-test ~]# ntpdate 0.asia.pool.ntp.org
25 Apr 16:17:54 ntpdate[2056]: step time server 203.107.6.88 offset 3699663.834363 sec
[root@myc-test ~]# hwclock --systohc
[root@myc-test ~]# date
2020年 04月 25日 星期六 16:18:07 CST

 

  1. 安装openldap,本次实验所有执行用户为root。

# yum 安装相关包
yum install -y openldap openldap-clients openldap-servers
 
# 复制一个默认配置到指定目录下,并授权,这一步一定要做,然后再启动服务,不然生产密码时会报错
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
# 授权给ldap用户,此用户yum安装时便会自动创建
chown -R ldap. /var/lib/ldap/DB_CONFIG
 
# 启动服务,先启动服务,配置后面再进行修改
systemctl start slapd
systemctl enable slapd
 
# 查看状态,正常启动则ok
systemctl status slapd
  1. 修改open ldap配置

  • 5
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 14
    评论
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值