openldap quick start guide
openldap 2.4 在centos 7 x64系统上部署
1 下载源码编译
解压
tar -xvf xx
./configure
make && make install
2 更改配置文件
默认在/usr/local/etc/openldap/slapd.ldif
主要更改 <MY-DOMAIN> and <COM>
dn: olcDatabase=mdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: mdb
OlcDbMaxSize: 1073741824
olcSuffix: dc=<MY-DOMAIN>,dc=<COM>
olcRootDN: cn=Manager,dc=<MY-DOMAIN>,dc=<COM>
olcRootPW: secret
olcDbDirectory: /usr/local/var/openldap-data
olcDbIndex: objectClass eq
Be sure to replace <MY-DOMAIN> and <COM> with the appropriate domain components of your
domain name. For example, for example.com, use:
dn: olcDatabase=mdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: mdb
OlcDbMaxSize: 1073741824
olcSuffix: dc=example,dc=com
olcRootDN: cn=Manager,dc=example,dc=com
olcRootPW: secret
olcDbDirectory: /usr/local/var/openldap-data
olcDbIndex: objectClass eq
把配置导入数据库
/usr/local/etc/slapd.d文件不存在可以先建立一个
su root -c /usr/local/sbin/slapadd -n 0 -F /usr/local/etc/slapd.d -l
/usr/local/etc/openldap/slapd.ldif
3 启动与验证
su root -c /usr/local/libexec/slapd -F /usr/local/etc/slapd.d
验证
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
4 添加
注意每一行冒号后有空格,其他地方不要加空格
example.ldif文件
dn: dc=example,dc=com
objectclass: dcObject
objectclass: organization
o: Example Company
dc: example
dn: cn=Manager,dc=example,dc=com
objectclass: organizationalRole
cn: Manager
ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f example.ldif
注意cn=Manager,dc=example,dc=com是配置里面定义的rootDN
Manager节点下添加一项
item.ldif
dn: cn=test2,cn=Manager,dc=novel,dc=com
cn: test2
sn: Test User
objectclass: person
ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f item.ldif
根下添加另外一个节点
node.ldif
dn: dc=novel,dc=com
objectclass: top
objectclass: dcobject
objectclass: organization
dc: novel
o: novel,Inc.
dn: ou=managers,dc=novel,dc=com
ou: managers
objectclass: organizationalUnit
ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f node.ldif
单独添加项目t.ldif
dn: cn=novel,ou=managers,dc=novel,dc=com
cn: novel
sn: wuyunhui
objectclass: person
ldapadd -x -D "cn=Manager,dc=example,dc=com" -w secret -f t.ldif
验证
ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'
5 更改
modi.ldif
dn: cn=test2,cn=Manager,dc=novel,dc=com
changetype: modify
replace: sn
sn: Test User ccccccf
ldapmodify -x -D "cn=Manager,dc=example,dc=com" -w secret -f t.ldif
编程相关
使用openldap库提供的接口可用使用C/C++访问ldap目录服务
ocsp协议相关接口openssl库有实现
参考:OpenLDAP-Admin-Guide
转载于:https://www.cnblogs.com/mingzhang/p/8624722.html
openldap quick start guide相关推荐
- 【连载】vSphere 4.0 问答之引子 ---《vSphere 4.0 Quick Start Guide》节选和粗译
这几天来正在细读<vSpherer 4.0 Quick Start Guide>,这确是一本好书啊.谷歌百度了一下,没找到中文版出版,因此萌发了连载一些选节并做部分翻译的念想.我素知自己不 ...
- CA AutoSys Workload Automation r11 Quick Resource Guide
https://supportcontent.ca.com/phpdocs/0/253/253_CA_AutoSys_WA_r11_Guide.pdf Documentation Increase y ...
- Leaflet文档阅读笔记-Quick Start Guide笔记
目录 网络加载JS和CSS 初始化地图 在地图上做标记 在地图上点击事件获得坐标 个人对这篇文档的体会 网络加载JS和CSS 先要加载css,然后在加载js <link rel="st ...
- [Cougaar]Cougaar快速开始指导(Cougaar Quick Start Guide)
[本文翻译自:http://cougaar.org/wp/documentation/cougaar-quick-start-guide/,笔者水平有限,部分内容自知翻译水准不够,仅供学习使用,转载或 ...
- Robochameleon——Quick Start Guide
Robochameleon classes 在这套程序包中有4个基础的类: pwr:表示信号功率 signal_interface:表示信号波形 unit:表示通信系统中的一个元素 module:元素 ...
- Commons Configuration2 - Quick start guide
原文:http://commons.apache.org/proper/commons-configuration/userguide/quick_start.html Reading a prope ...
- linux下guide编译不了,全志R16编译环境搭建指南,全志R16_Tina SDK Quick Start Guide
2. Tina SDK 目录结构 ├── tina │ ├── abi │ ├── app │ ├── bionic │ ├── build │ ├── device │ │ ├── softwinn ...
- vyos User Guide
vyos User Guide 来源 https://wiki.vyos.net/wiki/User_Guide The VyOS User Guide is focused on providing ...
- NVIDIA DRIVE AGX开发工具包
NVIDIA DRIVE AGX开发工具包 英伟达DRIVE™ AGX开发工具包提供了开发生产级自主车辆(AV)所需的硬件.软件和示例应用程序.NVIDIA DRIVE AGX系统建立在汽车产品级芯片 ...
最新文章
- Oracle常用傻瓜问题1000问
- pandas使用drop_duplicates函数基于subset参数指定的数据列子集删除重复行、并设置keep参数保留重复行中的最后一个数据行
- 'BatchNorm2d' object has no attribute 'track_running_stats'
- typedef,结构体,共用体,联合体
- 编译打包vue_Vue 源码分析( 一 )
- 项目总结-vue分页组件集成
- 一篇文章让你理解面试难点:执行上下文(干货满满(附面试题))
- Keil(MDK-ARM-STM32)系列教程(三)工程目标选项配置(Ⅰ)
- 数据结构07之哈希表
- 全局拉普拉斯平滑之(1)Strucutre extraction from texture via relative total variation及稀疏矩阵求解
- 随笔小杂记(三)——将遥感大图随机分割成小图作为训练集
- paper 63 :函数比较:imfilter与fspecial
- IP协议号与传输层端口
- .fit VS .fit_generator in Keras
- 华为不要php开发,华为手机开发者选项的利与弊!有些设置最好不要打开
- 小程序源码:2022虎年全新头像框制作
- 成长的烦恼:如何面对失败常态化的人生
- 2020最后1天朋友圈文案短句_2020余额不足,2021转账成功
- Prometheus浅析
- Opencv去除高光的算法--Highlights Removal