09-08-2023, 01:31 PM 
		
	
	Configure your PostgreSQL server to allow other systems to access the database remotely. To do so, let the server listen to all IP addresses by editing the configuration file.
Before proceeding, use the exit command to quit the PostgreSQL shell and return as the regular system user. Then, follow these steps:
- Open the configuration file using a text editor. Replace vim if you use another editor and change the directory accordingly:
 - Find the listen_addresses line.
 - Remove the # symbol and change the value to an asterisk. Here’s how it should look:
 - Use the :wq command to save the changes and quit vim.
 - Set the access policy to authenticate client connection to your PostgreSQL server. To do so, open the pg_hba.conf file in the same directory using vim. The command should look like this:
 - Add a new policy at the bottom of the file using this syntax:
 - For instance, we will enable all TCP/IP connections from all users to every PostgreSQL database. These users can use any IP address with an MD5-encrypted password. The rule looks as follows:
 - Restart the PostgreSQL service to apply the changes.
 
vim /etc/postgresql/14/main/postgresql.conf
        listen_addresses = '*'
        vim /etc/postgresql/14/main/pg_hba.conf
        connection database user ip_address encryption
        host all all 0.0.0.0/0 md5
        
