Configuring remote access to PostgreSQL
In this recipe, we will learn how to configure remote access to a Postgres server which is disabled by default. Postgres employs a method called host-based authentication and it is the purpose of this recipe to introduce you to its concepts in order to provide the access rights you need to run a safe and secure database server.
Getting ready
To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges and a text editor of your choice. It is expected that PostgreSQL is already installed and running.
How to do it...
In the previous recipe, we have already modified the host-based authentication configuration pg_hba.conf
file using sed
to manage our Postgres's client authentication from peer to md5
. Here we will make changes to it to manage remote access to our Postgres server.
To begin, log in as root and first open the firewall to allow any incoming PostgreSQL connections to the server:
firewall-cmd...