Configure PostgreSQL to allow remote connection.

preview_player
Показать описание
------------------------------------------------------------------------------------------------------------------------------------------
By default PostgreSQL is configured to be bound to "localhost".
------------------------------------------------------------------------------------------------------------------------------------------
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3737 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
As we can see above port 5432 is bound to 127.0.0.1. It means any attempt to
connect to the postgresql server from outside the machine will be refused.
------------------------------------------------------------------------------------------------------------------------------------------
.................................................................................................................................................

host all all 0.0.0.0/0 md5
host all all ::/0 md5
.................................................................................................................................................
OR
.................................................................................................................................................
host all all 127.0.0.1/32 scram-sha-256
host all all 0.0.0.0/0 scram-sha-256
_____________________________________________________________________________________
©2023
Рекомендации по теме