Search code examples
postgresqlubuntuufw

Cannot connect to postgresql from remote address


I'm use ubuntu 14.04 and postgresql 9.5.

I have allow the port in ufw, and setting configure files in postgresql. But I also cannot connect with it.

If I try to use telnet to my server at port 5432, it also connected timeout.

ufw setting: ➜ ~ ufw status Status: active

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere
443                        ALLOW       Anywhere
22                         ALLOW       Anywhere
5432                       ALLOW       Anywhere
8000                       ALLOW       Anywhere
80 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
5432 (v6)                  ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
8000 (v6)                  ALLOW       Anywhere (v6)

pg_hba:

local   all             postgres                                peer
host    all             all             all                     md5

postgresql.conf

listen_addresses = '*'
port = 5432

Solution

  • I have known the reason. My VPS provider close all port except 22 and 80