[Wylug-help] LDAP setup on Centos 7
Gary Stainburn
gary.stainburn at ringways.co.uk
Fri Nov 27 16:54:37 UTC 2015
The whole list of files is
[root at ollie2 ldap]# cat reset_ldap.sh
#!/bin/bash -x
systemctl stop slapd
rpm -e openldap-servers openldap-clients
cd /var/lib
rm -Rf ldap
cd /etc/openldap/
rm -Rf slapd.d/
yum -y install openldap-servers openldap-clients
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
systemctl start slapd
slaptest -F /etc/openldap/slapd.d
[root at ollie2 ldap]# cat setup_ldap.sh
#!/bin/bash -x
ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif
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
ldapmodify -Y EXTERNAL -H ldapi:/// -f chdomain.ldif
ldapadd -x -D cn=Manager,dc=ringways,dc=com -W -f basedomain.ldif
[root at ollie2 ldap]# cat chrootpw.ldif
# specify the password generated above for "olcRootPW" section
dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}bbn4VrMZ0CAt6rZtVWBUX+RruM8yz+d4
[root at ollie2 ldap]# cat chdomain.ldif
# replace to your own domain name for "dc=***,dc=***" section
# specify the password generated above for "olcRootPW" section
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=ringways,dc=com" read by * none
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=ringways,dc=com
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=ringways,dc=com
dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}HFbPOXoq0AZOmjLCQxsC0Ykj16G8XyHf
dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by
dn="cn=Manager,dc=ringways,dc=com" write by anonymous auth by self write by
* none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by dn="cn=Manager,dc=ringways,dc=com" write by * read
[root at ollie2 ldap]# cat basedomain.ldif
# replace to your own domain name for "dc=***,dc=***" section
dn: dc=ringways,dc=com
objectClass: top
objectClass: dcObject
objectclass: organization
o: Ringways
dc: Server
dn: cn=Manager,dc=ringways,dc=com
objectClass: organizationalRole
cn: Manager
description: Directory Manager
dn: ou=People,dc=ringways,dc=com
objectClass: organizationalUnit
ou: People
dn: ou=Group,dc=ringways,dc=com
objectClass: organizationalUnit
ou: Group
[root at ollie2 ldap]#
More information about the Wylug-help
mailing list