Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJZ7i-003rzi-PS for pgsql-admin@arkaria.postgresql.org; Fri, 06 Dec 2024 14:16:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tJZ7f-00CQ5v-Lr for pgsql-admin@arkaria.postgresql.org; Fri, 06 Dec 2024 14:16:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJZ7f-00CQ5m-8d for pgsql-admin@lists.postgresql.org; Fri, 06 Dec 2024 14:16:00 +0000 Received: from mx0a-0039f802.pphosted.com ([205.220.164.45]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJZ7b-001Mt3-SX for pgsql-admin@lists.postgresql.org; Fri, 06 Dec 2024 14:15:59 +0000 Received: from pps.filterd (m0209981.ppops.net [127.0.0.1]) by mx0b-0039f802.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B6BsJt0016338 for ; Fri, 6 Dec 2024 06:15:53 -0800 Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) by mx0b-0039f802.pphosted.com (PPS) with ESMTPS id 438112r2ud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 06 Dec 2024 06:15:53 -0800 (PST) Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-29e8124e922so1876149fac.2 for ; Fri, 06 Dec 2024 06:15:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733494542; x=1734099342; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ApIAM1T9LDfUX70SynxNTJ0XnnH7UhfcRWD+q/PJs2k=; b=SvH6AJezxvP50zHv0YpmuOdoBzACuVG4h5hLunePmheYG6IfRr878LKY+5/zm+Le2G +ATwgJz7c0QDUPUlqNGU+3tUU07V+eQsqhKMlRYNuI4fnKByY9QQyHIfdw/oIZvsvK37 +Udah30wslsWlsrQswfijmGM6ovN9omY3WaPiyfMFOO2mKLsSTcQRhbIcxAbI2fq+g5i u+a1CHsm1LzIDZeLmTiIr+pjI/pzrE8aSwtMRpTSJujdGhWgCmDveI1ZR9Zogd3p83H/ lB+/w566Mhx5Ha0ZAlCbtJSa0eYHlooUGTtMzgVF/9M8aB3A+VdpFxTFOAC1HnRm843t Ropg== X-Gm-Message-State: AOJu0YwAoyTlAzVhJY8acjBYxFBNzoK3uVKOS1X8dUHwWUjb4LzzJ/qi z/CRF7uAY+F5noLixZAqbwihJb9TJRXamdnMUa31jmSPYc2xYTxpo6Q/kS4ncUjq2bxTrk/7z/a VfBlqPmm7jexwEf1teaEmafrmeSUFZYqfR8U6IZeYvDV7KPcgyZIrR1CnTqu2KQv1HCNZKVAKy8 7YdGoKGW4I+G/1oByZYTAhCnDlbp0biD3zoCpZG8z4kFSXue/yHTjCZDY5qTU4jlJADu3MFxk5h hhY3Q== X-Gm-Gg: ASbGncuOr1FqtWVfKjuiLubp427b+NKA5cqv+XT7HX5MIE6WcQWMnOI9dwCz3UXTemM a1FiL1St3W6ZpaJROxo5Gsm/4WR2QsA== X-Received: by 2002:a05:6870:c095:b0:29e:671b:6019 with SMTP id 586e51a60fabf-29f734e58d5mr3001746fac.31.1733494542351; Fri, 06 Dec 2024 06:15:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY3/0jlUjOnp1gCpztWg3Ohha6nHsA1wOPu+Q3xn3Aq3h5MqjF5JhtRes1ez8YME/iTgz2KbdRdYxm9t/9N6w= X-Received: by 2002:a05:6870:c095:b0:29e:671b:6019 with SMTP id 586e51a60fabf-29f734e58d5mr3001702fac.31.1733494541754; Fri, 06 Dec 2024 06:15:41 -0800 (PST) MIME-Version: 1.0 From: Henry Ashu Date: Fri, 6 Dec 2024 06:15:31 -0800 Message-ID: Subject: How To Configure PostgreSQL to Use LDAP for Authentication To: pgsql-admin@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000061bbe506289aa6a9" X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-06_09,2024-12-06_01,2024-11-22_01 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000061bbe506289aa6a9 Content-Type: text/plain; charset="UTF-8" Hi, Please, I need help with how to configure postgresql to use LDAP for Authentication. *Here is what I have tried;* host all all 0.0.0.0/0 ldap ldapserver=ldap://adserver.domain.com ldapport=389 ldapprefix="DOMAIN\" ldapsuffix="" ldapbinddn= postgres-user@domain.com ldapbindpasswd=mypassword host all all 0.0.0.0/0 ldap ldapurl="ldaps://adserver.domain.com:636" ldapbasedn="OU=Users,OU=England 053,OU=Commercial Services,DC=domain,DC=com" ldapbinddn=" postgres-user@domain.com" ldapbindpasswd="mypassword" ldapsearchattribute="OU=Users,OU=England 053,OU=Commercial Services,DC=domain,DC=com" host all all 0.0.0.0/0 ldap ldapserver="adserver.domain.com" ldapport=636 ldapscheme="ldaps" ldapbasedn="OU=Users,OU=England 053,OU=Commercial Services,DC=domain,DC=com" ldapbinddn="OU=Users,OU=England 053,OU=Commercial Services,DC=domain,DC=com" ldapbindpasswd="mypassword" ldapsearchattribute="adservice-account" *And this is the error I'm getting;* [postgres@myserver ~]$ psql -U myuser mydatabase psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: FATAL: no pg_hba.conf entry for host "[local]", user "myuser", database "mydatabase", no encryption [postgres@myserver ~]$ psql -U "MYDOMAIN\myuser" mydatabase psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: FATAL: no pg_hba.conf entry for host "[local]", user "MYDOMAIN\myuser", database "mydatabase", no encryption Thank you *Henry Ashu* Database Administrator *o:* 503.672.5114 | *f:* 800.551.8821 | DAT.com [image: DAT Solutions] [image: Like us on Facebook] [image: Follow us on Twitter] [image: Connect with us on LinkedIn] [image: Visit our YouTube Channel] [image: Visit us on Instagram] --00000000000061bbe506289aa6a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Please, I need help with= how to configure postgresql to use LDAP for Authentication.=C2=A0

Here is what I have tried;

host all all 0.0.0.0/0 ldap ldapse= rver=3Dldap://adserver.domain.com ldapport=3D389 ldapprefix=3D"DOMAIN\" ldapsuffix=3D""= ldapbinddn=3Dpostgres-user@dom= ain.com ldapbindpasswd=3Dmypassword


host =C2=A0 =C2=A0all = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 all =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 0.0.0.0/0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ldap =C2=A0 =C2=A0 =C2=A0 =C2=A0ldapurl=3D"ldaps://adserver.domain.com:636" ldapb= asedn=3D"OU=3DUsers,OU=3DEngland 053,OU=3DCommercial Services,DC=3Ddom= ain,DC=3Dcom" ldapbinddn=3D"postgres-user@domain.com" ldapbindpasswd=3D"mypassword= " ldapsearchattribute=3D"OU=3DUsers,OU=3DEngland 053,OU=3DCommerc= ial Services,DC=3Ddomain,DC=3Dcom"



host =C2=A0 =C2=A0al= l =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 all =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 0.0.0.0/0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ldap =C2=A0 =C2=A0 =C2=A0 =C2=A0 ldapserver=3D"adserver.domain.com" =C2=A0 =C2=A0 ldap= port=3D636 =C2=A0 =C2=A0 ldapscheme=3D"ldaps" =C2=A0 =C2=A0 ldapb= asedn=3D"OU=3DUsers,OU=3DEngland 053,OU=3DCommercial Services,DC=3Ddom= ain,DC=3Dcom" =C2=A0 =C2=A0 ldapbinddn=3D"OU=3DUsers,OU=3DEngland= 053,OU=3DCommercial Services,DC=3Ddomain,DC=3Dcom" =C2=A0 =C2=A0 ldap= bindpasswd=3D"mypassword" =C2=A0 =C2=A0 ldapsearchattribute=3D&qu= ot;adservice-account"


And this is the error I'm getting;

[= postgres@myserver ~]$ psql -U myuser mydatabase
psql: error: connection = to server on socket "/run/postgresql/.s.PGSQL.5432" failed: FATAL= : =C2=A0no pg_hba.conf entry for host "[local]", user "myuse= r", database "mydatabase", no encryption
[postgres@myserv= er ~]$ psql -U "MYDOMAIN\myuser" mydatabase
psql: error: conne= ction to server on socket "/run/postgresql/.s.PGSQL.5432" failed:= FATAL: =C2=A0no pg_hba.conf entry for host "[local]", user "= ;MYDOMAIN\myuser", database "mydatabase", no encryption
<= /div>

Tha= nk you

Henry Ashu

Database Administrator
= o:=C2=A0503.672.5114=C2=A0|= =C2=A0f:=C2=A0800.551.8821=C2=A0|=C2=A0DAT.com

3D"DAT=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<= img src=3D"https://www.dat.com/site/assets/media/images/global/emails/signa= ture/social-li.png" alt=3D"Connect with us on LinkedIn" width=3D"20" height= =3D"20">=C2=A0=C2=A03D"Visit=C2=A0=C2=A03D"Visit
--00000000000061bbe506289aa6a9--