CentOS7 LDAP 2.4 安装配置

软件安装

# yum -y install openldap-servers openldap-clients

# systemctl start slapd

# systemctl enable slapd

 

密码修改

# slappasswd

New password:

Re-enter new password:

{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

# vim chrootpw.ldif

# specify the password generated above for "olcRootPW" section

dn: olcDatabase={0}config,cn=config

changetype: modify

add: olcRootPW

olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx // copy above

# ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif

 

 

基础Schema导入

# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif

# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif

# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif

 

 Ldap域数据生成

vim chdomain.ldif

# less chdomain.ldif 
# replace to your own domain name for "dc=***,dc=***" section
dn:olcDatabase={2}hdb,cn=config
changetype:modify
replace:olcSuffix
olcSuffix:dc=cnicg,dc=cn

dn:olcDatabase={2}hdb,cn=config
changetype:modify
replace:olcRootDN
olcRootDN:cn=Manager,dc=cnicg,dc=cn

dn: olcDatabase={1}monitor,cn=config
changetype:modify
replace:olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read by dn.base="cn=Manager,dc=cnicg,dc=cn" read by * none

 

# ldapmodify -Y EXTERNAL -H ldapi:/// -f chdomain.ldif

 

基础域数据

vim basedomain.ldif

# replace to your own domain name for "dc=***,dc=***" section

dn: dc=cnicg,dc=cn
objectClass: top
objectClass: dcObject
objectclass: organization
o: cnicg cn
dc: cnicg

 

dn: cn=Manager,dc=cnicg,dc=cn
objectClass: organizationalRole
cn: Manager
description: Directory Manager

dn: ou=People,dc=cnicg,dc=cn
objectClass: organizationalUnit
ou: People
 
dn: ou=Group,dc=cnicg,dc=cn
objectClass: organizationalUnit
ou: Group

 

# ldapadd -x -D cn=Manager,dc=cnicg,dc=cn -W -f basedomain.ldif

 

转载于:https://www.cnblogs.com/fatt/p/7081635.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值