Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #postgres #users #login #password
ADD COMMENT
Topic
Name
2+6 =