Remote Access to PG

Topic: This article explains how to enable MD5 authentication and remote access for Postgres metadata.

Environment: This article is written for Diyotta version 4.1 installed on embedded Postgres metadata. 

Setup MD5 authentication 

To enable MD5 authentication for embedded Postgres, need to follow the given steps:

1 . Stop the DIServer using the following command-

#${DI_HOME}/bin/servershutdown.sh

2. Modify the following lines in file ~/diserver/server/pgsql/direpdata/pg_hba.conf and change the authentication method from trust to MD5.


# TYPE DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local  all             all                                     md5
# IPv4 local connections:
host   all            all             127.0.0.1/32            md5
# IPv6 local connections:
host   all            all             ::1/128                 md5


Start DIServer

#${DI_HOME}/bin/serverstartup.sh


Setup Remote Access to Postgres Database

To access embedded Postgres database remotely, follow the below given steps.

1 . Stop the DIServer using the following commands-

#${DI_HOME}/bin/servershutdown.sh

2. Add the following line in file ~/diserver/server/pgsql/direpdata/pg_hba.conf

host    all             all             0.0.0.0/0            md5

3. Modify the following configuration parameter in file ~/diserver/server/pgsql/direpdata/postgresql.conf

listen_addresses = '*'

4. Start DIServer

#${DI_HOME}/bin/serverstartup.sh


 


On this page