I have VDS with ubuntu 24.04 and I install Postgres 16.6. My pq_hba.conf in
postgres=# SHOW hba_file;
hba_file
/etc/postgresql/16/main/pg_hba.conf
(1 row)
I wont connect to Postgres from all hosts, so I set in pq_hba.conf
local all postgres peer
local all all peer
host all all 0.0.0.0/0 md5
host all all ::0/0 md5
when I run (after restart Postgres)
ss -nlt | grep 5432
LISTEN 0 200 127.0.0.1:5432 0.0.0.0:*
127.0.0.1:5432 insted of 0.0.0.0:5432. So only localhost can connect to my postgres. But I want connect to Postgres from all hosts.
What am I doing wrong?