Remove an OU from OpenLDAP command line

Remove an OU from OpenLDAP command line

Remove an OU from OpenLDAP command line

In this example we have added the OU SkyNet, however since then, SkyNet has become self-aware and we need to remove it from the LDAP database before the real problems start. Let’s login, and su to root

OpenLDAP OU removal: In this example we have added the OU SkyNet, however since then, SkyNet has become self-aware and…

from here change to the temp directory to manipulate the LDAP database

OpenLDAP OU removal: change to the temp directory to manipulate the LDAP database

dump the LDAP database to file

OpenLDAP OU removal: dump the LDAP database to file

vi the dump

OpenLDAP OU removal: vi the dump

locate SkyNet

OpenLDAP OU removal: locate SkyNet

from here do a ctrl+c and then a :set nu

OpenLDAP OU removal: do a ctrl+c and then a :set nu

this should show us the line numbers

OpenLDAP OU removal: this should show us the line numbers

from here we want to write line 127 to a file named “SkyNet-Terminated”

OpenLDAP OU removal: we want to write line 127 to a file named “SkyNet-Terminated”

vi the File

OpenLDAP OU removal: vi the File

here’s the syntax to delete the OU

OpenLDAP OU removal: here’s the syntax to delete the OU

run this command to process the change

OpenLDAP OU removal: run this command to process the change

deleted!

OpenLDAP OU removal: deleted!

however, Given that it’s SkyNet, we had better make sure that it’s Actually gone from the database. Do another Dump

OpenLDAP OU removal: however, Given that it’s SkyNet, we had better make sure that it’s Actually gone from the database.…

from here vi the dump

OpenLDAP OU removal: vi the dump

from here we can search for SkyNet

OpenLDAP OU removal: we can search for SkyNet

cool, SkyNet has been exterminated!

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

Related guides: Add an OU to OpenLDAP command line | Remove user from openLDAP command line

Leave a Reply

Your email address will not be published. Required fields are marked *