Delete or Modify LDAP Entries

This section provides a tutorial example on how to delete or modify LDAP entries remotely.

How To Delete a LDAP Entry? You can use the "ldapdelete" command to delete a single entry or multiple entries.

1. Delete a single entry using "ldapdelete ... <dn>" command.

herong$ ldapdelete -x -D "cn=Manager,dc=herongyang,dc=com" -w TopSecret \
   -H ldap://192.168.1.100 "cn=Joe Doe,ou=IT,dc=herongyang,dc=com"

2. Delete multiple entries provided in a LDIF file.

herong$ vi old.ldif

dn: cn=Joe Doe,ou=IT,dc=herongyang,dc=com
changetype: delete

dn: cn=Bob Lee,ou=IT,dc=herongyang,dc=com
changetype: delete

herong$ ldapdelete -x -D "cn=Manager,dc=herongyang,dc=com" -w TopSecret \
   -H ldap://192.168.1.100 -f old.ldif

How To Modify a LDAP Entry? You can use the "ldapmodify" command to modify multiple entries provided in a LDIF file.

herong$ vi outdated.ldif

dn: cn=Joe Doe,ou=IT,dc=herongyang,dc=com
changetype: modify
replace: sn
sn: Kim

dn: cn=Bob Lee,ou=IT,dc=herongyang,dc=com
changetype: modify
replace: mail
mail: bob_lee@herongyang.com

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

 Process Management

 Files and Directories

 Users and Groups

 File Systems

 Block Devices and Partitions

 LVM (Logical Volume Manager)

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Software Package Manager on CentOS - DNF and YUM

 vsftpd - Very Secure FTP Daemon

 Postfix - Mail Transport Agent (MTA)

 Dovecot - IMAP and POP3 Server

 Email Client Tools - Mail User Agents (MUA)

LDAP (Lightweight Directory Access Protocol)

 What Is LDAP

 What Is OpenLDAP

 Install OpenLDAP Server on CentOS

 Configure OpenLDAP Server on CentOS

 Use OpenLDAP Client Tools

Delete or Modify LDAP Entries

 LDIF File Format

 Hierarchical Structure of LDAP Entries

 Install OpenLDAP Server on CentOS 8

 Configure Mozilla Thunderbird to Use LDAP

 LDAP Attributes Mapping in Mozilla Thunderbird

 Configure Apple iPhone to Use LDAP

 Administrative Tasks

 References

 Full Version in PDF/EPUB