This article provides information on how to configure PostGreSQL to allow remote connections (i.e. when the Recon Server is installed on a remote server).
By default, PostGreSQL does not allow remote connections and the following error could occur:
âNo connection could be made because the target machine actively refused itâ
To allow the Recon Server to connect to the PostGreSQL Server remotely, the following steps are required:
- First edit the postgresql.conf file Click on Start -> Programs -> PostgreSQL 8.2 -> Configuration -> Edit postgresql.conf
(Users can also find this file under the \Program Files\PostgreSQL 8.2\data directory).
- Scroll down to "Connections and Authentication"
- Uncomment the listen_addresses parameter by removing the #
- Replace the 'localhost' with the IP address of the PowerRecon Server (please note that the IP address must be encapsulated in single quotes as well) or specify '*' to allow the PostgreSQL Server to listen on all IP addresses.
- Edit the pg_hba.conf file (same path as in step 1). Add the IP address of the Recon Server under the IPv4 Local Connections section. Follow the same pattern as the host with 127.0.0.1/32, use spaces to separate entries on the columns, with the same number of spaces matching each underlying row. Enter the IP address as x.x.x.x/32.
For instance, using a remote Recon Server with an IP address of 10.1.2.28 as an example, the IPv4 section should appear as follows once the changes to the pg_hba.conf have been completed:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 10.1.2.28/32 md5
- Restart the PostgreSQL service