SPARCS 10 이대근 (harry). Contents Directory Service What is LDAP? Installation Configuration...

41
LDAP SPARCS 10 이이이 (harry)

Transcript of SPARCS 10 이대근 (harry). Contents Directory Service What is LDAP? Installation Configuration...

Page 1: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

LDAPSPARCS 10 이대근 (harry)

Page 2: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Contents

Directory Service What is LDAP? Installation Configuration ldap-utils User authentication with LDAP

Page 3: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Question

How can an organization keep one cen-tralized up-to-date phone book that ev-erybody has access to?

How can SPARCS share login informa-tion among all servers?

Page 4: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory Service

Page 5: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory

A directory is a map of the differences between names and values

More than directories of file system

Page 6: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory: examples

Word Definition

Dictionary

Name Phone number

Telephone directory

Domain name IP address

DNS

Page 7: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory service

The software system that stores, orga-nizes and provides access to informa-tion in a directory

Page 8: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory service vs RDBMS

Directory service Relational DBMS

Be read more often Data may be redundant if

it helps performance

Must May

Namespace

Be written more often Data must be unique (in

most case)

Not null Nullable

Page 9: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

X.500

A series of computer networking stan-dards covering electronic directory ser-vices

ProtocolsDAP: Directory Access ProtocolDSP: Directory System ProtocolDISP: Directory Information Shadowing Protocol

DOP: Directory Operational Bindings Management Protocol

Page 10: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

X.500 Directory service

Page 11: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

What is LDAP?

Page 12: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

LDAP

Lightweight Directory Access Protocoli.e., Lightweight DAP

A protocol to access directory service through TCP/IP

Designed at the University of Michigan

Page 13: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory structureFile system

Page 14: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Directory structureLDAP

Page 15: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Available backend typesType Descriptionbdb Berkeley DB transactional backend

dnssrv DNS SRV backendldbm Lightweight DBM backendldap LDAP (Proxy) backendmeta Meta Directory backend

monitor Monitor backendpasswd Provides read-only access to passwd(5)

perl Perl programmable backendshell Shell (external program) backendsql SQL programmable backend

Page 16: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Installation

Page 17: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Installation

Serverapt-get install slapd

Clientapt-get install ldap-utils

Page 18: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Configuration

Page 19: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

/etc/ldap/ldap.conf

include /etc/ldap/schema/core.schema

schemacheck on

pidfile /var/run/slapd/slapd.pid

argsfile /var/run/slapd.args

loglevel 0

database bdb

suffix "dc=sparcs,dc=net"

rootdn "cn=DsnManager,dc=sparcs,dc=net"

rootpw {SSHA}8DihK78pIOVntXZftMugdq4rxhYat03R

Page 20: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

slappasswd

Nice tool to generate hashed password

Sample output: {SSHA}8DihK78pIOVntXZftMugdq4rxhYat03R

You just need to copy&paste the output to configuration file

Page 21: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Access Control List

access to <ENTRY> by <DN> <PERMISSION> [ by <DN> <PERMISSION> … ]

Page 22: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Access Control List: Ex-ampledefaultaccess none

access to *

by self write

by dn=“.+” read

by dn=“^$$” read

by * none

#No permission by default

#Granting permission for all entries

#A user entry can modify itself

#An authenticated user can read

#An anonymous user can read

#Else granting no permission

Page 23: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Access Control List: Ex-ampleaccess to dn=“.*,dc=(.*),dc=(.*),dc=net”

attrs=children,entry,uid

by dn=“cn=Administrator,dc=$1,dc=$2” write

Page 24: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Caution

No blank around separator(,)dn=“dc=example,dc=com” (O)dn=“dc=example, dc=com” (X)

ACL is not overriddenDetails should precede the general configs

The more complicated ACL, the slower search results

Page 25: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldap-utils

Page 26: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldap-utils

Common usage <command> –D <Base DN>

–W –f <LDIF_FILE_PATH>

Page 27: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapadd

Define which schema is used objectclass: dcobject

Describe all ‘Must’ attributes dn: dc=mydomain,dc=com

dc: database

Page 28: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapadd: example

objectclass: dcobject

dn: dc=mydomain,dc=com

dc: database

Page 29: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapsearch: scope

Page 30: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapsearch: filters

(cn=harry) (cn=h*) (cn~=pipe) (cn>=harry) (&(cn=h*)(cn=*y)) (|(cn=h*)(cn=*y)) (!(cn=harry))

Page 31: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapsearch: example

sn=Daniels

givenname=Charlene

Page 32: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapmodify Declare which entry you want to modify

dn: cn=harry,dc=sparcs,dc=org State what kind of change will occur

changetype: modify / add / delete (if changetype: modify)

State what kind of modification will occurreplace: cnadd: sndelete: sn

Enter the value of the attribute if necessarycn: hodduc

Page 33: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapmodify: example

dn: cn=harry,dc=sparcs,dc=org

changetype: modify

replace: cn

cn: hodduc

Page 34: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapmodrdn

Declare which entry you want to modify

Enter new RDN

Page 35: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

ldapmodrdn: example

cn=harry,dc=sparcs,dc=org

cn=noname

Page 36: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

User authentication with LDAP

Page 37: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Client

apt-get install libnss-ldap libpam-ldap nss-updatedb nscd ldap-auth-client

Configuration files/etc/ldap.conf/etc/auth-client-config/profile.d/ldap-auth-

config/etc/pam.d//etc/nssswitch.conf

Page 38: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Server

Automatic migration toolsapt-get install migrationtools

Page 39: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Question?

Page 40: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Web sites & Documenta-tions http://wiki.kldp.org/wiki.php/LDAP-Tips

Nice KOREAN document explaining how to configure for LDAP authentication

http://50001.com/sub/down/ldap.docAlso nice Korean document explaining gen-

eral usage of LDAP

Page 41: SPARCS 10 이대근 (harry). Contents  Directory Service  What is LDAP?  Installation  Configuration  ldap-utils  User authentication with LDAP.

Thank youI’m very sleepy