Wednesday, December 20, 2006

OpenLDAP 指令

ldapsearch -x -b "dc=osa,dc=com" "(cn=Janny)"

ldapadd -x -W -D "cn=root,dc=osa,dc=com" -f my.ldif

ldapmodify -x -W -D "cn=root,dc=osa,dc=com" -f my.ldif

ldapdelete -x -W -D "cn=root,dc=osa,dc=com" "cn=janny,ou=linux,dc=osa,dc=com"

ps. To delete the whole database
service ldap stop
rm -f /var/lib/ldap/*

ps2. We can set some default values for these commands
vi /etc/openldap/ldap.conf

BASE dc=osa,dc=com
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666
URI ldap://linux.kirika.idv.tw
HOST linux.kirika.idv.tw

#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
TLS_CACERTDIR /etc/openldap/cacerts
TLS_REQCERT never

Then, we don't need to give -b and -h in the commands.

No comments: