1. Tambahkan repo EPEL 7
wget -c http://mirror.dionipe.net/fedora/epel/7/x86_64/e/epel-release-7-5.noarch.rpm2. Pasang paket-paket yang dibutuhkan
yum localinstall epel-release-7-5.noarch.rpm
yum install openldap-clients openldap-servers phpldapadmin migrationtools3. Jalankan layanan openldap-server
systemctl start slapd4. Muat skema standar
systemctl enable slapd
systemctl status slapd
cd /etc/openldap/schema/5. Set Database Suffix
for U in *.ldif; do echo "Memuat skema $U... "; ldapadd -H ldapi:/// -f $U; done
cd
cat suffix.entry6. Set Root DN
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=azoebs,dc=com
ldapmodify -H ldapi:/// -f suffix.entry
cat rootdn.entry7. Set Password Root
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=manager,dc=azoebs,dc=com
ldapmodify -H ldapi:/// -f rootdn.entry
slappasswd8. Edit file konfigurasi phpLDAPadmin:
New password:
Re-enter new password:
{SSHA}EPHnQJa7TZqZ7Pa2Xf9OIVF8HbEQvwMW
cat rootpw.entry
dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootPW
olcRootPW: {SSHA}EPHnQJa7TZqZ7Pa2Xf9OIVF8HbEQvwMW
ldapmodify -H ldapi:/// -f rootpw.entry
vim /etc/phpldapadmin/config.php9. Edit konfigurasi alias phpLDAPadmin di httpd
$servers->setValue('server','host','127.0.0.1');
$servers->setValue('server','base',array('dc=azoebs,dc=com'));
$servers->setValue('login','bind_id','cn=manager,dc=azoebs,dc=com');
$servers->setValue('login','attr','dn');
vim /etc/httpd/conf.d/phpldapadmin.conf10. Jalankan layanan httpd
IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
/IfModule>
systemctl start httpd11. Tambah service http di firewall
systemctl enable httpd
systemctl status httpd
firewall-cmd --add-service=http --permanent12. Aktifkan otentikasi lewat LDAP pada SELinux
firewall-cmd --reload
firewall-cmd --list-services
setsebool -P allow_ypbind=113. Login phpLDAPadmin
Login DN: cn=manager,dc=azoebs,dc=com
Password:
Uji menambahkan ldif
1. Impor ldif object organization (o) dan organizational unit (ou) seperti berikut:
dn: dc=azoebs,dc=com2. Buat satu user Linux
objectclass: dcObject
objectclass: organization
o: azoebs
dc: azoebs
dn: ou=People,dc=azoebs,dc=com
objectClass: organizationalUnit
ou: People
useradd utian3. Import ldif account passwd.utian.ldif di phpLDAPadmin
passwd utian
grep utian /etc/passwd > passwd.utian
/usr/share/migrationtools/migrate_passwd.pl passwd.utian passwd.utian.ldif
cat passwd.utian.ldif
dn: uid=utian,ou=People,dc=azoebs,dc=com
uid: utian
cn: utian
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$6$3nfzV/Ts$WpiaHhHzUn5J7/mQRLbVqv9n6cd5tvk/xd9rrq3Y53v4GMhl1Rz9QEgdriwe107A9mSR7Zvn8ADvYmZo154cc.
shadowLastChange: 16505
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1000
homeDirectory: /home/utian
2 comments:
5. Set Database Suffix
cat suffix.entry
6. Set Root DN
cat rootdn.entry
udah nyobain lahkah-nya dari awal tapi bingung di langkah ini, bisa dijelaskan 'cat' yang dimaksud di langkah 5 dan 6 ini pak :) terima kasih
itu maksudnya bikin berkas teks yang isinya kalo "di-cat" seperti itu bosss :D
Post a Comment