Score:1

Firewall setting are correct but port still closed form outside

cn flag

I setting up machien for connect to postgresql remotly I check somthing and it's apeare all things is correct

Checking the port status :

$> sudo netstat -tulpn | grep LISTEN | grep 5432

tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 18134/postgres

Checking the firewall

$> sudo ufw status | grep 5432

5432 ALLOW Anywhere

Ping inside machine work :

$> telnet 185.235.x.x 5432

Connected to 185.235.x.x

But when call from outside of machine

 $> telnet 185.235.x.x 5432
  
 Connecting ... (And then timeout)

What should I do else ?

Update

the pg_hba.cof :

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5
host    all             all             0.0.0.0/0               md5
Irsu85 avatar
cn flag
Are you connecting from the local network or an external network?
pLumo avatar
in flag
Allowing connections to your database from the internet is not a very clever idea.
pLumo avatar
in flag
Please add your relevant `pg_hba.conf` setting --> See https://stackoverflow.com/questions/3278379/how-to-configure-postgresql-to-accept-all-incoming-connections
Ali najjar avatar
cn flag
@Irsu85 From external netwrok The machine has an static ip
Ali najjar avatar
cn flag
@pLumo yes but it's for debuging. I add this to question now
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.