2

PostgreSQL 13 is running on a remote machine in a docker container. I can't get access to it remotely in any way, the error is

no pg_hba.conf entry for host,

ssl is disabled.

Connect from the local machine by the host name localhost or 127.0.0.1 is excellent. But if I set a own IP of the current server 192.168.1.102 - I am getting the error. And from any remote machine it is the same

postgresql.conf

listen_addresses = '*'
pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
#host    all             all             127.0.0.1/32           trust
host     all             all             all                    trust
# IPv6 local connections:
host     all             all             ::1/128                trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             ::1/128                 trust

host all all all md5

I did a container restart and the postgres user has a password

Thanks

1 Answer 1

3

Try use

docker run --publish=192.168.1.102:<exposed-port>:<container-port> postgresql-image

Also make sure you can ping to IP from other PC. Firewalls, Virus guards etc should check.

There are a great number of solutions described here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.