PARDUS

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
alltrue
depth2
pageOpenLDAP


LDIF KULLANIMI

Ldap sunucuları veritabanlarına benzer bir yapıda verilerini saklamaktadır.

...

  • Organizasyon.ldif dosyamız aşağıdaki gibi olsun

dn: o=anabina,dc=gecici,dc=org

objectClass: organization

objectClass: top


dn: ou=muhasebe,o=anabina,dc=gecici,dc=org

objectClass: organizationalUnit

objectClass: top


dn: ou=ik,o=anabina,dc=gecici,dc=org

objectClass: organizationalUnit

objectClass: top

  • ldapadd -h sunucu1 -D "cn=admin,cn=admin,dc=gecici,dc=org" -f organizasyon.ldif -W

...

  • Kullanıcılar.ldif dosyamız aşağıdaki gibi olsun

dn: cn=ahmet,ou=muhasebe,o=anabina,dc=gecici,dc=org

objectClass: person

objectClass: inetOrgPerson

objectClass: organizationalPerson

objectClass: posixaccount

objectClass: top

gidNumber: 3000

homeDirectory: /home/ahmet/

sn: mutlu

uid: ahmet

uidNumber: 10000


dn: cn=esra,ou=muhasebe,o=anabina,dc=gecici,dc=org

objectClass: person

objectClass: inetOrgPerson

objectClass: organizationalPerson

objectClass: posixaccount

objectClass: top

gidNumber: 3000

homeDirectory: /home/esra/

sn: mutluay

uid: esra

uidNumber: 10001


dn: cn=mehmet,ou=ik,o=anabina,dc=gecici,dc=org

objectClass: person

objectClass: inetOrgPerson

objectClass: organizationalPerson

objectClass: posixaccount

objectClass: top

gidNumber: 3000

homeDirectory: /home/mehmet/

sn: mesut

uid: mehmet

uidNumber: 10002


dn: cn=ayse,ou=ik,o=anabina,dc=gecici,dc=org

objectClass: person

objectClass: inetOrgPerson

objectClass: organizationalPerson

objectClass: posixaccount

objectClass: top

gidNumber: 3000

homeDirectory: /home/ayse/

sn: mesutlu

uid: ayse

uidNumber: 10003

  • ldapadd -h sunucu1 -D "cn=admin,cn=admin,dc=gecici,dc=org" -f kullanicilar.ldif -W

...

  • mail.ldif dosyamız aşağıdaki gibi olsun.

dn: cn=ahmet,ou=muhasebe,o=anabina,dc=gecici,dc=org

changetype: modify

add: mail

mail: ahmet@gecici.org

-

add: userPassword

userPassword: ahmet1

-

add: loginShell

loginShell: /bin/bash/


dn: cn=esra,ou=muhasebe,o=anabina,dc=gecici,dc=org

changetype: modify

add: mail

mail: esra@gecici.org

-

add: userPassword

userPassword: esra1

-

add: loginShell

loginShell: /bin/bash/


dn: cn=mehmet,ou=ik,o=anabina,dc=gecici,dc=org

changetype: modify

add: mail

mail: mehmet@gecici.org

-

add: userPassword

userPassword: mehmet1

-

add: loginShell

loginShell: /bin/bash/


dn: cn=ayse,ou=ik,o=anabina,dc=gecici,dc=org

changetype: modify

add: mail

mail: ayse@gecici.org

-

add: userPassword

userPassword: ayse1

-

add: loginShell

loginShell: /bin/bash/

  • ldapmodify -h sunucu1 -D "cn=admin,dc=gecici,dc=org" -f mail.ldif -W -c

...

  • maildegistir.ldif dosyamız aşağıdaki gibi olsun

dn: cn=ahmet,ou=muhasebe,o=anabina,dc=gecici,dc=org

changetype: modify

replace: mail

mail: ahmet.mutlu@gecici.org

  • ldapmodify -h sunucu1 -D "cn=admin,dc=gecici,dc=org" -f maildegistir.ldif -W -c

...

  • Degistir.ldif dosyamız aşağıdaki gibi olsun

dn: cn=mehmet,ou=ik,o=anabina,dc=gecici,dc=org

changetype: modrdn

newrdn: cn=mehmet

deleteoldrdn: 1

newsuperior: ou=muhasebe,o=anabina,dc=gecici,dc=org

  • ldapmodify -h sunucu1 -D "cn=admin,dc=gecici,dc=org" -f degistir.ldif -W -c

...

  • sil.ldif dosyamız aşağıdaki gibi olsun 
cn=mehmet,ou=muhasebe,o=kurum,dc=kak,dc=pendik,dc=bel,dc=tr
  • ldapdelete -h sunucu1 -D cn=admin,dc=kak,dc=pendik,dc=bel,dc=tr -f sil.ldif -W -c

...