How To Install ruby-pg-ldap-sync on Kali Linux

In this tutorial we learn how to install ruby-pg-ldap-sync on Kali Linux. ruby-pg-ldap-sync is Synchronize users and groups from LDAP/AD into PostgreSQL

Introduction

In this tutorial we learn how to install ruby-pg-ldap-sync on Kali Linux.

What is ruby-pg-ldap-sync

ruby-pg-ldap-sync is:

LDAP is often used for a centralized user and role management in an enterprise environment. PostgreSQL offers different authentication methods, like LDAP, SSPI, GSSAPI or SSL. However, for any method the user must already exist in the database, before the authentication can be used. There is currently no direct authorization of database users on LDAP. So roles and memberships has to be administered twice.

This program helps to solve the issue by synchronizing users, groups and their memberships from LDAP to PostgreSQL. Access to LDAP is used read-only. pg_ldap_sync issues proper CREATE ROLE, DROP ROLE, GRANT and REVOKE commands to synchronize users and groups.

It is meant to be started as a cron job.

There are three methods to install ruby-pg-ldap-sync on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install ruby-pg-ldap-sync Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install ruby-pg-ldap-sync using apt-get by running the following command:

sudo apt-get -y install ruby-pg-ldap-sync

Install ruby-pg-ldap-sync Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install ruby-pg-ldap-sync using apt by running the following command:

sudo apt -y install ruby-pg-ldap-sync

Install ruby-pg-ldap-sync Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install ruby-pg-ldap-sync using aptitude by running the following command:

sudo aptitude -y install ruby-pg-ldap-sync

How To Uninstall ruby-pg-ldap-sync on Kali Linux

To uninstall only the ruby-pg-ldap-sync package we can use the following command:

sudo apt-get remove ruby-pg-ldap-sync

Uninstall ruby-pg-ldap-sync And Its Dependencies

To uninstall ruby-pg-ldap-sync and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove ruby-pg-ldap-sync

Remove ruby-pg-ldap-sync Configurations and Data

To remove ruby-pg-ldap-sync configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge ruby-pg-ldap-sync

Remove ruby-pg-ldap-sync configuration, data, and all of its dependencies

We can use the following command to remove ruby-pg-ldap-sync configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge ruby-pg-ldap-sync

Dependencies

ruby-pg-ldap-sync have the following dependencies:

References

Summary

In this tutorial we learn how to install ruby-pg-ldap-sync package on Kali Linux using different package management tools: apt, apt-get and aptitude.