`
iwindyforest
  • 浏览: 233640 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

openldap configuration leaning note

阅读更多

hostname // to display the computer name

hostname <changed name> // to change

go to: /etc/sysconfig/network, add/modify HOSTNAME=NEWNAME to change permenately

dont forget to change /etc/hosts after you change your hostname,

127.0.0.1 localhost.localdomain localhost

 

 

// the following part mainly is from brightmoon 's blog:

http://blog.csdn.net/hitabc141592/article/details/22931179

 

 

// copy template

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

 

// create a passwd for ldap admin# slappasswd{SSHA}pfAJm+JJa4ec2y8GjTc8uMEJpoR5YKLy

a passwd like the above would be displayed, save/remember it for later use

 

// edit config file

# vim /etc/openldap/slapd.conf

database        bdb
suffix          "dc=centos,dc=com"
checkpoint      1024 15
rootdn          "cn=admin,dc=
centos,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
rootpw {SSHA}pfAJm+JJa4ec2y8GjTc8uMEJpoR5YKMn

 

//for rootdn, if your hostname is centos.com, and your current user is in admin group, it should be like this

rootdn          "cn=admin,dc=centos,dc=com"

 

// copy db config file# cp /usr/share/openldap-servers/DB_CONFIG.example  /var/lib/ldap/DB_CONFIG

 

// remove all file under /etc/openldap/slapd.d/* -- very very important!

// actually, I found the files are not deleted by using the following,

// when I navigate to /etc/openldap/slapd.d/ , I saw there are still file under this directory

// so I used rm -rf * under this directory

// when you delete all file under /etc/openldap/slapd.d/, make sure all file under this directory are deleted

// or you would always get "invalid credential" error# rm -rf /etc/openldap/slapd.d/*

 

// restart server and make slapd automaticall started by default# service slapd restart
# chkconfig slapd on

 

// grant access to ldap:ldap user# chown -R ldap:ldap /var/lib/ldap
# chown -R ldap:ldap /etc/openldap/

 

// test and generate config file under /etc/openldap/slapd.d , very important

// once this step is done, it should be displayed the message: config file testing succeeded,

slaptest  -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d

 

// check /etc/openldap/slapd.d/cn=config to cat the file olcDatabase={2}bdb.ldif

// if it is correctly executed, you update in /etc/openldap/slapd.conf should be mapped as following:

// if it is not changed to map your update, there must be something wrong with your previous steps

// got check util you see the right update, or you would always got "credential errors"

olcSuffix: dc=centos,dc=com
olcAddContentAcl: FALSE
olcLastMod: TRUE
olcMaxDerefDepth: 15
olcReadOnly: FALSE
olcRootDN: cn=admin,dc=centos,dc=com

// grant ldap:ldap full access, others not

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

 

// use migrationtools to export all existing system accounts to ldif files# yum install migrationtools -y

 

# vi  migrate_common.ph

 

...

# Default DNS domain
$DEFAULT_MAIL_DOMAIN = "centos.com";
# Default base
$DEFAULT_BASE =
"dc=centos,dc=com";

 

# ./migrate_base.pl > /tmp/base.ldif
# ./migrate_passwd.pl  /etc/passwd > /tmp/passwd.ldif
# ./migrate_group.pl  /etc/group > /tmp/group.ldif

 

 

the password admin is the password set in slapd.conf file, "cn=admin,dc=centos,dc=com"  is the rootdn # ldapadd -x -D "cn=admin,dc=centos,dc=com" -w admin -f /tmp/base.ldif
# ldapadd -x -D "cn=admin,dc=
centos,dc=com" -w admin -f /tmp/passwd.ldif
# ldapadd -x -D "cn=admin,dc=
centos,dc=com" -w admin -f /tmp/group.ldif

# service slapd restart

 

once you set up the configuration, the following comand can be used to fetch all the entries under the base dn:

ldapsearch -x -H ldap://centos.com -b 'dc=centos,dc=com'

 

ldap browser can be used

分享到:
评论

相关推荐

    OpenLdap安装及配置

    OpenLDAP 安装及配置 OpenLDAP 是一种轻量级目录访问协议(LDAP),它可以提供身份验证、授权和目录服务。OpenLDAP 安装及配置是一个复杂的过程,需要安装 BerkeleyDB、OpenLDAP 服务器,并进行相应的配置。 1. ...

    openldap

    OpenLDAP 是一个开源的轻量级目录访问协议(Lightweight Directory Access Protocol)实现,它提供了对目录服务的强大支持。在IT行业中,OpenLDAP 被广泛用于存储和管理组织结构数据,例如用户账户、联系人信息、组...

    OpenLdap2.4各版本包

    OpenLDAP(开放轻量目录访问协议)是一种开源的目录服务,用于存储和管理网络资源的信息,如用户账户、组、网络设备等。OpenLDAP 2.4系列是其一个重要且广泛应用的版本,提供了多种功能和改进,以适应不同的操作系统...

    CAS整合OpenLDAP(OpenLDAP已配置好的情况)

    《CAS整合OpenLDAP的详细步骤》 CAS(Central Authentication Service),由 Jasig 组织开发,是一个开源的、基于Java的Web应用,主要用于实现单点登录(Single Sign-On,SSO)。在许多组织中,为了统一管理和认证...

    windows 下安装和使用OpenLDAP。

    Windows 下安装和使用 OpenLDAP OpenLDAP 是一个开源的 LDAP 服务器实现,它提供了一个轻量级的目录访问协议,基于 X.500 标准,但比 X.500 简洁许多。OpenLDAP 支持 TCP/IP,适合Internet 环境。目录是一个专业的...

    [openldap]Linux下安装openldap所需要的依赖包,源码安装方式

    db-4.7.25.tar.gz freetype-2.3.5.tar.gz ...openldap-2.4.38.tgz php-5.2.9.tar.gz phpldapadmin-0.9.8.5.tar.gz zlib-1.2.8.tar 包含上述安装包,都是源码包,通过编译安装,在CentOs5.0下运行通过

    windows版的openldap

    OpenLDAP是一款开源的轻量级目录访问协议(Lightweight Directory Access Protocol)服务器,适用于各种操作系统,包括Windows。在Windows环境下安装和配置OpenLDAP对于本地开发和测试是非常有用的,因为它允许...

    openldap-rpm.tar.zip

    包含了openldap的所有依赖 cyrus-sasl-2.1.26-23.el7.x86_64.rpm cyrus-sasl-lib-2.1.26-23.el7.x86_64.rpm cyrus-sasl-devel-2.1.26-23.el7.x86_64.rpm compat-openldap-2.3.43-5.el7.x86_64.rpm openldap-2.4.44...

    编译windows版本openldap

    OpenLDAP是一种开源的轻量级目录访问协议(Lightweight Directory Access Protocol)服务器,它提供了对分布式目录服务的支持。在Windows环境下编译OpenLDAP可以让开发者在本地进行定制化开发或者适应特定的系统需求...

    windows下搭建并配置OpenLDAP服务器

    在Windows环境下搭建并配置OpenLDAP服务器是一项常见的任务,特别是在企业级环境中,为了实现用户身份验证、数据共享和服务集成。OpenLDAP(Lightweight Directory Access Protocol)是一个开源的LDAP服务器,广泛...

    Linux下OpenLDAP的安装软件

    在IT领域,Linux系统是广泛使用的服务器操作系统,而OpenLDAP(OpenLDAP Public License)则是一个开源的轻量级目录访问协议( Lightweight Directory Access Protocol)实现。它提供了组织和存储数据的强大功能,...

    win32 openLdap 2.2.29 安装文件

    OpenLDAP 是一个开源的轻量级目录访问协议(Lightweight Directory Access Protocol)服务器,它用于存储和管理结构化数据,如用户账号、组、网络设备信息等。在Windows环境下,OpenLDAP提供了方便的安装包来简化...

    源码安装openldap2.4.45

    OpenLDAP是一款开源的轻量级目录访问协议(Lightweight Directory Access Protocol)服务器,它提供了对LDAP目录服务的强大支持。在Linux环境下,通过源码安装OpenLDAP可以更好地定制配置以满足特定需求。以下是对...

    Centos7OpenLDAP主从配置

    CentOS 7 OpenLDAP 主从配置 OpenLDAP 是一个开源的轻量级目录访问协议(LDAP)实现,广泛应用于身份验证、授权和目录服务等领域。下面详细介绍 CentOS 7 环境下 OpenLDAP 的主从配置。 OpenLDAP 主从配置环境 在...

    openldap-2.5.4

    OpenLDAP是开源的轻量级目录访问协议(Lightweight Directory Access Protocol)实现,它提供了一个灵活、可扩展的目录服务,用于存储和管理各种类型的数据,如用户账号、组织结构、网络设备信息等。OpenLDAP-2.5.4...

    centos6.7OpenLDAP主从配置

    ### CentOS 6.7 OpenLDAP 主从配置详解 #### 系统环境信息 - **操作系统**: CentOS release 6.7 - **环境准备**: - 关闭防火墙: `/etc/init.d/iptables stop && chkconfig iptables off` - 关闭 NetworkManager:...

    OpenLDAP文档.pptx

    OpenLDAP文档 OpenLDAP 是一款轻量级目录访问协议(Lightweight Directory Access Protocol,LDAP),属于开源集中账号管理架构的实现,且支持众多系统版本,被广大互联网公司所采用。OpenLDAP 账号集中管理软件...

    Linux UNIX OpenLDAP实战指南

    《Linux UNIX OpenLDAP实战指南》是一本专注于OpenLDAP在Linux和UNIX系统中应用的专业书籍,由郭大勇撰写。OpenLDAP是一种开源的轻量级目录访问协议(Lightweight Directory Access Protocol)实现,广泛用于组织和...

    openldap2.4数据同步研究

    ### OpenLDAP2.4数据同步研究 #### 一、概述 OpenLDAP是一个广泛使用的开源LDAP(轻量级目录访问协议)服务实现。随着版本的不断更新,OpenLDAP2.4引入了许多新的特性和改进,其中之一就是对数据同步机制的重大...

Global site tag (gtag.js) - Google Analytics