Rabu, 28 Maret 2012

Konfigurasi LDAP Server

Berikut adal langkah-langkah konfigurasinya:
membuat openldap database
# mkdir /var/lib/ldap/newmoon.com
# chown ldap:ldap /var/lib/ldap/newmoon.com

membuat encrypt password untuk user openldap
# slappaswd
New password :
Re-enter new password:
{SSHA}k/bdghcfhdskjchzcxjzxc

Copy password diatas ke rootpw yang ada di file slapd.conf
edit file slapd.conf
# vi /etc/openldap/slapd.conf
suffix “dc=newmoon,dc=com”
rootdn “cn=Manager,dc=newmoon,dc=com”
rootpw {SSHA}k/bdghcfhdskjchzcxjzxc
directory /var/lib/ldap/newmoon.com

start service ldap
# service ldap start

membuat akun untuk openldap user
# useradd –g users yatno
# passwd yatno



extract user details dan password ke format LDIF
# grep root /etc/passwd > /etc/openldap/passwd.root
# grep yatno /etc/passwd > /etc/openldap/passwd.yatno
# locate –u
# locate migrate_passwd.pl
# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.root /etc/openldap/root.ldif

# /usr/share/openldap/migration/migrate_passwd.pl /etc/openldap/passwd.yatno /etc/openldap/yatno.ldif

# vi /etc/openldap/root.ldif
Edit pada bagian dc=padl menjadi dc=newmoon

# vi /etc/openldap/yatno.ldif
Edit pada bagian dc=padl menjadi dc=newmoon

# vi /etc/openldap/newmoon.com.ldif
dn: dc=newmoon,dc=com
dc: newmoon
description: Root LDAP entry
objectClass: dcObject
objectClass: organizationalUnit
ou:rootObject

dn: ou=People, dc=newmoon,dc=com
ou: People
description: All people
objectClass: organizationalUnit

import LDIF file ke database openldap
# ldapadd –x –D “cn=Manager,dc=newmoon,dc=com” –W –f /etc/openldap/newmoon.com.ldif
# ldapadd –x –D “cn=Manager,dc=newmoon,dc=com” –W –f /etc/openldap/root.ldif
# ldapadd –x –D “cn=Manager,dc=newmoon,dc=com” –W –f /etc/openldap/yatno.ldif

Verifikasi entry
# ldapsearch –x –b “dc=newmoon,dc=com”

Install dan Konfigurasi LDAP Client

# authconfig
Pilih ldap
Masukkan alamat ip address dan parameter ldapnya

# mkdir /home/yatno
# cp /etc/skel/.* /home/yatno
# chmod 700 /home/yatno
# chown yatno:users /home/yatno
# chown yatno:users /home/yatno/.*

Sekarang (pada client) silahkan login dengan user (ldap).

1 komentar:

  1. baru nyampe perintah kedua koq saya punya lgsung error ya mas...? "chown: invalid user: `ldap:ldap'"
    itu infonya.. mohon bimbingan nya ya..

    BalasHapus