O'Reilly logo

PostgreSQL 9 Administration Cookbook by Hannu Krosing, Simon Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Integrating with LDAP

This recipe shows how to set up your PostgreSQL system so that it uses LDAP (lightweight Directory Access Protocol) for authentication.

Getting ready

Ensure that the usernames in database and your LDAP server match, as this method works for user authentication checks for users already defined in the database.

How to do it...

In PostgreSQL's authentication file, pg_hba.conf, define some of address ranges to use LDAP as an authentication method, and configure the LDAP server for this addess range.

host all all 10.10.0.1/16 ldap \
ldapserver=ldap.our.net ldapprefix="cn=" ldapsuffix=", dc=our, dc=net"

How it works...

This setup makes postgresql server check passwords from the configured LDAP server.

User rights are not queried from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required