Difference between revisions of "PostgreSQL pg hba.conf"

From wikieduonline
Jump to navigation Jump to search
Line 40: Line 40:
 
* <code>[[/etc/postgresql/12/main/postgresql.conf]]</code>
 
* <code>[[/etc/postgresql/12/main/postgresql.conf]]</code>
 
* <code>[[$HOME/.pg_service.conf]]</code>
 
* <code>[[$HOME/.pg_service.conf]]</code>
* <code>[Nest] 41  - 09/27/2022, 10:12:12 PM  ERROR [ExceptionHandler] no pg_hba.conf entry for host "20.10.2.58", user "your-user", database "your-db", SSL off</code>
+
* <code>[Nest] 41  - 09/27/2022, 10:12:12 PM  ERROR [ExceptionHandler] [[no pg_hba.conf entry for host]] "20.10.2.58", user "your-user", database "your-db", SSL off</code>
 
* <code>[[no pg_hba.conf entry for host]]</code>
 
* <code>[[no pg_hba.conf entry for host]]</code>
  

Revision as of 14:28, 3 February 2023

https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

pg_hba.conf client authentication configuration file.


https://www.postgresql.org/docs/11/runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS


Remote communication

cat /etc/postgresql/*/main/pg_hba.conf | grep -v "#" | grep .
local   all             postgres                                peer
local   all             all                                     peer
host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5


To allow remote communications from all IPs [1]:

/etc/postgresql/*/main/pg_hba.conf 
local   all             postgres                                peer
local   all             all                                     peer
host    all             all             0.0.0.0/0               md5
host    all             all             ::/0                    md5
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

Related terms

See also

  • https://stackoverflow.com/questions/18580066/how-to-allow-remote-access-to-postgresql-database
  • Advertising: