Install OpenLDAP on Centos7

Source: Internet
Author: User
Tags openldap

Install OpenLDAP on Centos7

I. Environment preparation

Echonameserver114.114.114.114>/etc/resolv. conf # Change dnsecho192.168.0.20.hello.com>/etc/hostssystemctldisablefirewalld. service & systemctlstopfirewalld. service # disable the firewall sed-I's // # SELINUX/SELINUX = disable/G'/etc/selinux/config # permanently close the selinuxsetenforce0rpm-Uvhhttp: // disable

2. Configure the Administrator Password

①. After the slappasswd or slappasswd-s password (-s password) is entered, a string of encryption strings will be generated, for example, {SSHA} 5Qiqn6d4U4U9b1G8A7dKmJAkJcUOA4fE #.

②. Vim chrootpw. ldif

# Define "olcRootPW" sectiondn: olcDatabase = {0} config, cn = configchangetype: modifyadd: olcRootPWolcRootPW: the password generated above ldapadd-YEXTERNAL-Hldapi: //-fchrootpw. ldifldapadd-YEXTERNAL-Hldapi: //-f/etc/openldap/schema/cosine. ldifldapadd-YEXTERNAL-Hldapi: //-f/etc/openldap/schema/nis. ldifldapadd-YEXTERNAL-Hldapi: //-f/etc/openldap/schema/inetorgperson. the return value of ldif is as follows:

3. Set your domain name in the database

1. Generate Password

Slappasswd

2. vi chdomain. ldif

# Replacetoyourowndomainnamefor "dc = ***, dc = ***" section # region "olcRootPW" sectiondn: olcDatabase = {1} monitor, cn = configchangetype: modifyreplace: olcAccessolcAccess: {0} to * bydn. base = "gidNumber = 0 + uidNumber = 0, cn = peercred, cn = external, cn = auth" readbydn. base = "cn = admin, dc = hello, dc = com" readby * nonedn: olcDatabase = {2} hdb, cn = configchangetype: modifyreplace: olcSuffixolcSuffix: dc = hello, dc = comdn: olcDatabase = {2} hdb, cn = configchangetype: modifyreplace: olcRootDNolcRootDN: cn = admin, dc = hello, dc = comdn: olcDatabase = {2} hdb, cn = configchangetype: modifyadd: olcRootPWolcRootPW: Password generated in step 1 dn: olcDatabase = {2} hdb, cn = configchangetype: modifyadd: olcAccessolcAccess: {0} toattrs = userPassword, shadowLastChangebydn = "cn = admin, dc = hello, dc = com" writebyanonymousauthbyselfwriteby * noneolcAccess: {1} todn. base = "" by * readolcAccess: {2} to * bydn = "cn = admin, dc = hello, dc = com" writeby * read

3. ldapmodify-y external-H ldapi: //-f chdomain. ldif

4. vi basedomain. ldif

# Pipeline "dc = ***, dc = ***" sectiondn: dc = hello, dc = comobjectClass: topobjectClass: dcObjectobjectclass: organizationo: qiqiucomdc: qiqiudn: cn = admin, dc = hello, dc = comobjectClass: organizationalRolecn: admindescription: Directoryadmindn: ou = People, dc = hello, dc = comobjectClass: organizationalUnitou: leledn: ou = Group, dc = hello, dc = comobjectClass: organizationalUnitou: Group

5. ldapadd-x-D cn = admin, dc = hello, dc = com-W-f basedomain. ldif

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.