postgresql server access

Enable Remote Access To Postgresql 9.5 DB

Enable Remote Access To, We have installed PostgreSQL 9.5 Server on the Linux machine. The Installation procedure is the same for all versions of the PostgreSQL server. you can allow remote access connections to Postgresql server in Linux.

By default, the Postgresql server allows access to a client locally using a socket.

Check Out: Installation of PostgreSQL Database Server

Step 1: if you have successfully configured PostgreSQL server, you will see all the files inside in this data directory as shown in figure

ls /var/lib/pgsql/data/

Enable Remote Access To

Step 2: Now you have to configure postgresql.conf file

By default, These are the configuration in the file.

postgresql server access

Changed Listen to address to ‘*’ and remove the ‘#’.

postgresql server remote access

It will allow the server to listen to requests to all addresses.

Check Out: Error “ Job For Postgresql.service failed ”

Step 3: Now you need to define the host and only they can connect to this server. 

vim /var/lib/pgsql/data/pg_hba.conf

This will allow any host to access the PostgreSQL database with an encrypted password. I have allowed all the networks.

allow connections to postgresql

Check Out: How To Install Podman and Run Container On Linux 8

Step 4: Configure firewall that will allow PostgreSQL to listen on Port number 5432

firewall-cmd –permanent –add-port=5432/tcp

firewall-cmd –reload

allow postgresql remote connections

Step 5: Restart the PostgreSQL service

systemctl restart postgresql

Check Out: Add Port in firewall

Step 6: Test the remote connection to PostgreSQL

psql –h –u postgres

You will see Postgres shell

You’re done allow connections to postgresql remote

Leave a Reply

2 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
2 Comment authors
No.8 Rejuvenation Serum ReviewsGreen Force Keto Reviews Recent comment authors
newest oldest most voted
Notify of
Green Force Keto Reviews

Quality posts is the crucial to be a focus for the users to visit the web page, that’s what this website is providing.

No.8 Rejuvenation Serum Reviews

Its not my first time to go to see this web page,
i am browsing this web page dailly and obtain pleasant data from here all the time.