Postgresql pg_hba.conf

Asked

Viewed 164 times

1

I have a server with a Servlet + a postgresql database. I would like only Servlet to connect to the database.

When I set up pg_hba.conf with local all md5 Servlet cannot connect to the database. Then I need to set up how host all 127.0.0.1 255.255.255.255 md5

With this second configuration I am leaving postgresql open for any external IP?

  • There is no error, my question is whether the server is getting open for any external connection.

  • Ah good excuse, I got it wrong

  • Anyway I thank you

2 answers

1

To stay open to any machine you must put

host    all             all             0/0             md5

thus releases to any machine

0

Configure

host all 127.0.0.1/32 md5

host "all banks" "all users" "localhost" "password-protected"

So the database can only be accessed as localhost.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.