no pg_hba.conf for host

Viewed 605

I get following error when I try to connect using Beekeeper-Studio :

no pg_hba.conf entry for host "105.104.156.80", use"sdgij;sdhfhhuih", database"uhoidfgiosdff", no encryption

Here is my pg_hba.conf file:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

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

Your database server is only accepting connections from local clients:

host all all 127.0.0.1/32 md5

You need to add a line to pg_hba.conf that allows connections from your local network, something like so:

host all all 105.104.156.0/24 md5

But you should be VERY cautious with making changes to pg_hba.conf as you can let in hackers on your server if not careful. See the documentation for details. In particular, you should reduce the allowed address range, the database to connect to and possibly the list of allowed users.

Related