OpenLDAP commands

  • ldapadd (Used to add new ldap entries):
    ldapadd -x -D 'cn=Manager,dc=example,dc=com' -W  -f /tmp/user.ldif
    

  • ldapmodify (Used to add or modify ldap entries):
    ldapmodify -x -D 'cn=Manager,dc=example,dc=com' -W  -f /tmp/user.ldif 
    

  • ldapdelete is used to delete entries:
    ldapdelete -x -D 'cn=Manager,dc=example,dc=com' -W 'cn=user,ou=IT,dc=example,dc=com'
    
    or
    ldapdelete -x -D 'cn=Manager,dc=example,dc=com' -W -f /tmp/user.ldif 
    

  • ldapsearch used to search ldap servers
    ldapsearch -x -L -b 'dc=example,dc=com' 'objectclass=posixAccount'
    
    ldapsearch -x -LL -b 'dc=example,dc=com' 'cn=Rick Francis'
    

    Previous Pageprevious First Pagetop Next Pagenext