5

I have a server with postgresql-9.4 fresh install and I have another server with LDAP already installed. I want to connect postgresql with LDAP user that already exists.

What's the basic configuration that I should change in /var/lib/pgsql/9.4/data/pg_hba.conf and what else I should do?

2 Answers 2

6

Thanks everyone, I just made a change in /var/lib/pgsql/9.4/data/pg_hba.conf with :

local all all ldap ldapserver=ldap.server ldapport=389 ldaptls=0 ldapprefix="uid=" ldapsuffix=",ou=People,dc=domain,dc=com" 

And the authentication works!

2
  • this worked for me: ldapprefx="cn=" ldapsuffix=",cn=Users,dc=example,dc=com" Commented Sep 8, 2017 at 22:55
  • 1
    do you need to create users first in the database? Commented Apr 9, 2019 at 9:54
3
  1. Read the Friendly Manual:

http://www.postgresql.org/docs/9.5/static/auth-methods.html

  1. You probably want to use https://github.com/larskanis/pg-ldap-sync to sync your LDAP users and groups to PostgreSQL

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.