user4959618
user4959618

Reputation:

How to configure the pg_hba.conf file so that only the user postgres can access locally?

I have two users:

I configured the file pg_hba.conf with this line

host all postgres 127.0.0.1/32 md5.

But still allows me to login with user locally. How to configure correctly so that only the postgres user can access locally?

Upvotes: 0

Views: 1337

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246798

Remove the line that reads

local   all   all        trust

and replace it with

local   all   postgres   trust

Don't forget to run pg_hba reload.

Upvotes: 1

Related Questions