Linux LDAP configuration

Source: Internet
Author: User
Tags ldap administrator password openldap

Network resource lookup, user access control, authentication information query, network security, business Network general database services and security services.

Directory service is a special kind of database system, and it is specially optimized for reading, browsing and searching operation.

/etc/openldap / ldap.conf define the global content

Copy the configuration file: /usr/share/openldap-servers/slapd.conf.obsolete

Cp/usr/share/openldap-servers/slapd.conf.obsolete/etc/openldap/slapd.conf

Create Administrator Password:

slappasswd

I typed it here. 123456

{Ssha} Widkj2k3lackyaz8cbocattgookmemua

Slaptest-f/ETC/OPENLDAP/SLAPD.CONF-F/ETC/OPENLDAP/SLAPD.D

SERVICESLAPD restart

Copy the configuration file: /usr/share/openldap-servers/db_config.example

Cp/usr/share/openldap-servers/db_config.example/var/lib/ldap/db_config

Chmod640/etc/openldap/slapd.conf

Chown Ldap:ldap slapd.conf

Restart Service

create several users such as: User1/user2/user3

installation Migrationtools.noarch Package

To edit a file:

/usr/share/migrationtools/migrate_common.ph

# Default DNS Domain

$DEFAULT _mail_domain= "my-domain.com";

# Default Base

$DEFAULT _base = "dc=my-domain,dc=com";

./migrate_passwd.pl/etc/passwd >/home/user.ldif

./migrate_group.pl/etc/group >/home/group.ldif

/usr/share/migrationtools/migrate_base.pl>/home/base.ldif

Edit three files:

[Email protected]]# catexample.ldif

Dn:dc=my-domain,dc=com

Dc:my-domain

Objectclass:dcobject

Objectclass:organizationalunit

Ou:my-domain.com

[Email protected]]# catou_people.ldif

Dn:ou=people,dc=my-domain,dc=com

Objectclass:organizationalunit

Ou:people

[Email protected]]# cat ou_group.ldif

Dn:ou=group,dc=my-domain,dc=com

Objectclass:organizationalunit

Ou:group

/ETC/OPENLDAP/SLAPD.D all the content below

Modify the owning group:

/var/lib/ldap

/etc/openldap/

The following will import these three files into LDAP , so LDAP database, we have the users we want.

Ldapadd-x-D "cn=manager,dc=my-domain,dc=com"-w-f/home/base.ldif

Ldapadd-x-D "cn=manager,dc=my-domain,dc=com"-w-f/home/user.ldif

Ldapadd-x-D "cn=manager,dc=my-domain,dc=com"-w-f/home/group.ldif

Restart SLAPD Service

Test:

Ldapsearch-x-B "dc=my-domain,dc=com"

The following information is displayed:

# user1, people,my-domain.com

Dn:uid=user1,ou=people,dc=my-domain,dc=com

Uid:user1

Cn:user1

Objectclass:account

Objectclass:posixaccount

Objectclass:top

Objectclass:shadowaccount

Userpassword::e2nyexb0fsq2jfrdmtixu0puje5ldgxwstzqtljhdg5nedvsd2o3rwh0wmdhz2j

Klmnjrjbhugq3uehmwvdtoedoyuhzbhz0znzvwuf0au5wzfhbtw9hogjitnkwdwnkedrbqlrwnxuw

shadowlastchange:17216

shadowmin:0

shadowmax:99999

Shadowwarning:7

Loginshell:/bin/bash

uidnumber:501

gidnumber:502

Homedirectory:/home/user1


This article is from the "Little v Yun Road" blog, make sure to keep this source http://victor2016.blog.51cto.com/6768693/1901484

Linux LDAP configuration

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.