Running Postgresql 9.5 on Ubuntu 16.04.
My /etc/postgresql/9.5/main/pg_hba.conf:
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 postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
#remote connection
host all all 0.0.0.0/0 trust
My /etc/postgresql/9.5/main/postgresql.conf:
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
# - Security and Authentication -
#authentication_timeout = 1min # 1s-600s
#ssl = true # (change requires restart)
#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
# (change requires restart)
My netstat -nlp | grep 5432:
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 22621/postgres
tcp6 0 0 :::5432 :::* LISTEN 22621/postgres
unix 2 [ ACC ] STREAM LISTENING 10261951 22621/postgres /var/run/postgresql/.s.PGSQL.5432
I'm able to connect locally, but can't connect remotely. When I try to connect from another computer, the command times out.