Thread: How To Configure PostgreSQL to Use LDAP for Authentication
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"
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
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
Re: How To Configure PostgreSQL to Use LDAP for Authentication
From
Achilleas Mantzios - cloud
Date:
On 12/6/24 16:15, Henry Ashu wrote:
Fix your pg_hba.conf, LDAP is the least of your problems.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
Yes, we got this working by formatting the pg_hba.conf entry correctly. Thanks!
On Fri, Dec 20, 2024 at 12:33 AM Achilleas Mantzios - cloud <a.mantzios@cloud.gatewaynet.com> wrote:
On 12/6/24 16: 15, Henry Ashu wrote: 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\"ZjQcmQRYFpfptBannerStartThis Message Is From an Untrusted SenderYou have not previously corresponded with this sender.ZjQcmQRYFpfptBannerEnd
On 12/6/24 16:15, Henry Ashu wrote:Fix your pg_hba.conf, LDAP is the least of your problems.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