Доступ к Postgress с других IP

1. Внести изменения в файл:

nano /etc/postgresql/{версия PGSQL 17/18}/main/postgresql.conf

строка:

listen_addresses = '*' # what IP address(es) to listen on;

  1. Внести изменения в файл:

nano /etc/postgresql/{версия PGSQL 17/18}/main/pg_hba.conf

local all postgres md5

local all all peer

host all all 0.0.0.0/0 trust

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

  1. Перезапустить PGSQL:

systemctl restart postgresql

31 views·1 share