Tuesday, July 14, 2015

Connecting via Remote host using postgresql

When the instance of postgres is inside vm and you are on the host machine with some stack such as Node, the scenario becomes as if connecting from a remote host. To make it possible, we have to make postgres listen to remote (all) hosts and also specify the IP of that host.
1. To add the ip to the allowed host list, edit /etc/postgresql/9.1/main/pg_hba.conf and add the lines
host all all 192.168.0.1/24 md5
where 192.168.0.1 is the IP of the host you want to connect from.
2. And to enable listening from remote hosts, edit the file /etc/postgresql/9.1/main/postgresql.conf and add the following line
listen_addresses = '*'
Credits http://www.thegeekstuff.com/2014/02/enable-remote-postgresql-connection/

No comments:

Post a Comment

Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.

Connect Rapoo MT750S with Linux (Tested on Manjaro)

 I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...