Re: [MASSMAIL]Cannot connect to postgresql on port 5432

From: "Peter M(dot) Groen" <peter(at)osdev(dot)nl>
To: soumik(dot)bhattacharjee(at)kpn(dot)com, gilberto(dot)castillo(at)etecsa(dot)cu
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: [MASSMAIL]Cannot connect to postgresql on port 5432
Date: 2019-12-24 10:06:31
Message-ID: ed7858d8a1755dd333f572a3fbed86d2fe68b175.camel@osdev.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

It also possible to change the '*' to the ip-address of your NIC.
Or use a comma separated list for all ip-addresses you want to allow.

listen_addresses='<your_ip_address>, 127.0.0.1'

pg_hba is only used for client-addresses and connection types...
--
Open Systems Development B.V.
Peter M. Groen
Managing Director
Rooseveltstraat 18-P
2321 BM Leiden
+31 6 12 08 95 62
email : peter(at)osdev(dot)nl
skype : peter_m_groen

On Mon, 2019-12-23 at 19:44 +0000, soumik(dot)bhattacharjee(at)kpn(dot)com wrote:
> Thanks Gilberto, yes I did that, but won't this be a security issue?
>
> I tried this below in pg_hba.conf , but no help.
>
> host all all 0.0.0.0/0 md5
>
> So I think listen_addresess ='*' is the only way out.
>
> Thanks..
>
>
> -----Original Message-----
> From: gilberto(dot)castillo(at)etecsa(dot)cu <gilberto(dot)castillo(at)etecsa(dot)cu>
> Sent: maandag 23 december 2019 20:34
> To: Bhattacharjee, Soumik <soumik(dot)bhattacharjee(at)kpn(dot)com>
> Cc: pgsql-admin(at)lists(dot)postgresql(dot)org; pgsql-admin(at)postgresql(dot)org
> Subject: Re: [MASSMAIL]Cannot connect to postgresql on port 5432
> Importance: High
>
> Hi
>
> You might change postgresl.conf the line listening = '*'
>
> El 2019-12-23 14:30, soumik(dot)bhattacharjee(at)kpn(dot)com escribió:
> > Hi Experts,
> >
> > Post installation of PostgreSQL it is not listening on an IP, only
> > on
> > localhost.
> >
> > Please suggest your inputs.
> >
> > USED BELOW COMMAND FOR INSTALLATIONS –
> >
> > # APT-GET INSTALL POSTGRESQL-12
> >
> > postgres=# select version();
> >
> > version
> >
> > -----------------------------------------------------------------
> > -----
> > --------------------------------------------
> >
> >
> > PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu,
> > compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
> >
> > (1 row)
> >
> > ENTRIES IN ::: /ETC/POSTGRESQL/12/MAIN/PG_HBA.CONF
> >
> > # Database administrative login by Unix domain socket
> >
> > local all postgres pee
> > r
> >
> > #
> > TYPE DATABASE USER ADDRESS METHO
> > D
> >
> >
> > # "local" is for Unix domain socket connections only
> >
> > local all all pee
> > r
> >
> > # 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 pee
> > r
> >
> > host replication all 127.0.0.1/32 md5
> >
> > host replication all ::1/128 md5
> >
> > NOT CONNECTED
> >
> > POSTGRES(at)SRV:/OPT$ NETSTAT -NLP | GREP 5432
> >
> > (Not all processes could be identified, non-owned process info
> >
> > will not be shown, you would have to be root to see it all.)
> >
> > tcp 0 0 127.0.0.1:5432 0.0.0.0:*
> > LISTEN 25857/postgres
> >
> > unix 2 [ ACC ] STREAM LISTENING 74234
> > 25857/postgres /var/run/postgresql/.s.PGSQL.5432
> >
> > POSTGRES(at)SRV:~$ TELNET 10.133.214.32 5432
> >
> > Trying 10.133.214.32...
> >
> > telnet: Unable to connect to remote host: Connection refused

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Amine Tengilimoglu 2019-12-24 13:27:50 Re: Postgres cluster HA
Previous Message soumik.bhattacharjee 2019-12-23 19:44:48 RE: [MASSMAIL]Cannot connect to postgresql on port 5432