Modify postgresql.conf:
1. Open the file /var/lib/pgsql/data/postgresql.conf in a text editor
Add the following line at the end of the file:
listen_addresses = ‘*’
Save the changes and close the file.
Modify pg_hba.conf:
Open the file /var/lib/pgsql/data/pg_hba.conf in a text editor
Add the following line at the end of the file:
host same role all 203.0.113.2/32 md5
203.0.113.2/32 – a remote IP address from which connection is allowed. To allow connections from any IP address, specify 0.0.0.0/0.
md5 – authentication method, which requires the client to supply a double-MD5-hashed password for authentication.
Restart PostgreSQL service to apply the changes:
# service postgresql restart