Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLDjM-00080c-8g for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Oct 2019 21:54:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iLDjK-0001hO-Jr for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Oct 2019 21:54:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLDjK-0001h8-8G for pgsql-bugs@lists.postgresql.org; Thu, 17 Oct 2019 21:54:46 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iLDjH-0004Ac-RG for pgsql-bugs@lists.postgresql.org; Thu, 17 Oct 2019 21:54:45 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 27E8C5F79F; Thu, 17 Oct 2019 17:54:43 -0400 (EDT) Date: Thu, 17 Oct 2019 17:54:43 -0400 From: Stephen Frost To: k.yudhveer@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16064: Ldap Authentication failing with pg_hba.conf entry Message-ID: <20191017215442.GQ6962@tamriel.snowman.net> References: <16064-9dd182cda52e2eef@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="oBjF1iT4MJPwKp+I" Content-Disposition: inline In-Reply-To: <16064-9dd182cda52e2eef@postgresql.org> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --oBjF1iT4MJPwKp+I Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * PG Bug reporting form (noreply@postgresql.org) wrote: > Can any one please guide me what is the issue with my ldap authentication= on > Postgresql 10.10. Here is the Entry for ldap in pg_hba.conf file >=20 > host all all XX.XX.XXX.XX/32 ldap=20 > ldapserver=3DXX.XX.XXX.XX ldapbasedn=3D"ou=3DPeople,dc=3Dinternal,dc=3Dco= m" > ldapbinddn=3D"cn=3DTom,ou=3DPeople,dc=3Dinternal,dc=3Dcom" ldapbindpasswd= =3D"Test123#" > ldapport=3D389 >=20 > I created the same user "Tom" in the Postgres database too . Also created > the User "Tom" other user "svc-ldap" in active directory too. >=20 > When I am trying to connect to PostgreSQL server from other remote server, > the authentication is failing with=20 >=20 > psql: FATAL: no pg_hba.conf entry for host "XXX.XX.XXX.XXX", user "Tom", > database "Tom", SSL off Unfortunately, you haven't provided what the specific IP addresses are, but it looks like perhaps they don't match...? Note that when you specify a '/32', the IP address in the pg_hba.conf must match EXACTLY the IP address that the connection attempt is coming from. All that said, you mention that you're using Active Directory, which itself actually uses Kerberos for authentication- not LDAP, and PostgreSQL directly supports Kerberos authentication through GSSAPI. I strongly encourage you to look into use GSSAPI instead, it's much more secure than using LDAP-based auth and avoids the user's password being sent to the PostgreSQL server (where it could be compromised if the PG process is compromised). Thanks, Stephen --oBjF1iT4MJPwKp+I Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdqOMiAAoJEO1sijiDR2RVvEYP/2Mx7vy5EOU5Y58fC42l+1Ky mheLwBBajmxkOpqwj0CgcTs2iMl4ikZaY4w4gqX9wZ7L8ty/0ITD/Cktzd2uwxK5 a83MV0x4kJ6JuOG9Sgmfq4QgsJzL6C9RVGkvVUAhMyR4fKJXjT9lbeHU0U0jV9Rg oI3QxTVv/xQmJX4YXyqmy2SjmBvKqFhQ1bUMmi7K+chV5DSVeCobI5XXvXPqWXWl Ew6+08uGcLgl2Hl9cmRUyznuwANxjq0kHDpt/5WnXvTFlJbGEeR72Wy+XFG+5rnL a95EBvKrTpbBpEYHwkdhxQW/E1A4RreBZpT7lHsGXSq9vDkvtVSbzzk2PnAg3ksF SexxhbhvQ3zwVj1UXhfcsO0MZLAltZh+hTE09dij29dc+caCmyhoiBcIA4+56U8O ITElBReNJeUUSEh3h3PN5xdlvcbNsKTcHgT4mh20EVvNizmY/OY50Y5S12cyMQIG T9982ocwmxgTfce+0jpA7J3l0SXBSokE2r6yZI38VGB/q9p5+uBklECZMDeXhJ5f W6hs7ievfL4UVS4X4QdVgwSlWVYz22NPNvCiNlc3dwW8qyNv43MuvpYnTrCHXBrl y7zXaMCzMzm6gRXrTEOjQPU4/I5lOfs0CZMOruCdTIqQZJXoNCfEwvAsDFCZGB7P IKAWm9Ktldx6s72d3BG5 =4E5t -----END PGP SIGNATURE----- --oBjF1iT4MJPwKp+I--