PostgreSQL pg_hba.conf

1

I have a server with a servlet + a database in postgreSQL. I would like only the servlet to connect to the database.

When I configure pg_hba.conf with local all all md5 the servlet can not connect to the database. Then I need to configure it as host all 127.0.0.1 255.255.255.255 md5

With this second configuration I'm leaving postgreSQL open for any external IP?

    
asked by anonymous 01.11.2016 / 18:51

2 answers

1

To stay open for any machine you should put

host    all             all             0/0             md5

so it frees up any machine

    
12.01.2018 / 21:16
0

Configure

host all 127.0.0.1/32 md5

host " all " all password "

So the bank can only be accessed as localhost.

    
02.11.2016 / 22:22