Using LDAP in Ubuntu

Updated: 2017-06-25
Created: 2017-06-20 10:32:00

1, Install

sudo apt-get install lbdb libnet-ldap-perl

2, Setup

mkdir ~/.lbdb
touch ~/.lbdb/rc
touch ~/.lbdb/ldap.rc

.lbdb/rc

METHODS="m_ldap"
LDAP_NICKS="anynick"

.lbdb/ldqp.rc

%ldap_server_db = (
    'anynick' => ['ldaps://xxx.xxx.xxx:636',
                    'ou=people',
                    'cn mail', 'cn mail department',
                    '${mail}', '${cn}', '${department}']
);

$ignorant = 1;
$ldap_bind_dn = 'domian\id';
$ldap_bind_password = 'password';
1;

3, Usage

lbdbq xxx

4, integrating into mutt

add below line to ~/.muttrc

set query_command="lbdbq '%s'"