Answers for "postgres users can login with any or no password"

0

postgres users can login with any or no password

#Find the right pg_hba.conf file.

sudo -u postgres psql
openproject_dev=# SHOW hba_file ;
              hba_file               
-------------------------------------
 /usr/local/var/postgres/pg_hba.conf
(1 row)

# Edit the file to force password login ... Leave admin (superuser) as trust. I used md5 instead of password .. password worked as well.
sudo nano /usr/local/var/postgres/pg_hba.conf

# "local" is for Unix domain socket connections only
local   all             admin                                   trust
local   all             all                                     md5
# IPv4 local connections:
host    all             admin           127.0.0.1/32            trust
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             admin           ::1/128                 trust
host    all             all             ::1/128                 md5
Posted by: Guest on October-20-2021

Code answers related to "postgres users can login with any or no password"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language