I would like to perform ldap queries using an alternate file (which is intended to be used with pam.d and so have the same format as /etc/ldap.conf)

I think of using ldapsearch. In the manual, I cannot find any help for this purpose.

Is it possible to perform ldap queries using an alternate conf file?

My /etc/pam.d/myservice use the module pam_ldap with option config=/etc/myservice.ldap.conf.

2 Answers 2


For my understanding the /etc/ldap.conf just gives defaults for the parameters of the ldap utilities (like ldapsearch).

If you want to override that defaults you can specify them as command parameters when executing ldapsearch

See ldapsearch --help


You should export the LDAPCONF or LDAPRC environment variable to specify the path to your file. See: http://www.openldap.org/software/man.cgi?query=ldap.conf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .