S
S
Shurik2020-12-21 23:19:57
PostgreSQL
Shurik, 2020-12-21 23:19:57

Why can't I connect to postgressql from the internet?

Hello. Help pliz solve the problem of connecting to postgres from the network.
The essence of the problem is as follows. Installed postgres 13 on the server. Connecting to it via ssh to pg, it turns out to connect, but from the network via pgadmin it gives the following error:
"Unable to connect to server:
failed to connect to the server: No route to the host
It really works at the address "ip server"
and accepts TCP- connections (port 5432)?"

Googling the problem, I did the following:
1. Added host all 0.0.0.0/32 scram-sha-256 in the pg_hba.conf file (I also tried the IP of the machine I'm connecting from)
2. Added listen_adresses = "*" in the postgres.conf file

Did not help.
Please also note that the command

netstat -nltp | grep 5432
outputs the following:
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 13051/postmaster
tcp6 0 0 :::5432 :::* LISTEN 13051/postmaster

don't know if postmaster should be there. I'm not particularly good at administration. Maybe 5432 is busy, I think something. fig knows.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-12-21
@galaxy

I don't know if the postmaster should be there. I'm not particularly good at administration. Maybe 5432 is busy, I think something. who knows

everything is fine there
failed to connect to server: No route to host

And here the problem is not only in pg_hba. You don't have a route to the server. Check what you have set in pgadmin as the server address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question