Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijh5l-0004Gm-C6 for pgsql-admin@arkaria.postgresql.org; Tue, 24 Dec 2019 10:07:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ijh5i-0002Nn-Iu for pgsql-admin@arkaria.postgresql.org; Tue, 24 Dec 2019 10:07:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ijh5i-0002NH-2v; Tue, 24 Dec 2019 10:07:02 +0000 Received: from 87-253-140-15.colo.transip.net ([87.253.140.15] helo=mail.osdev.nl) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ijh5b-0002C8-Gm; Tue, 24 Dec 2019 10:07:00 +0000 X-Clacks-Overhead: "GNU Terry Pratchett" Received: from optiplex64.osdev.nl (83-160-143-48.ip.xs4all.nl [83.160.143.48]) (authenticated bits=0) by mail.osdev.nl (8.14.4/8.14.4) with ESMTP id xBOA6WoR010273 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Tue, 24 Dec 2019 11:06:32 +0100 Message-ID: Subject: Re: [MASSMAIL]Cannot connect to postgresql on port 5432 From: "Peter M. Groen" To: soumik.bhattacharjee@kpn.com, gilberto.castillo@etecsa.cu Cc: pgsql-admin@lists.postgresql.org, pgsql-admin@postgresql.org Date: Tue, 24 Dec 2019 11:06:31 +0100 In-Reply-To: <2A91BEF8171A5349931391E0C721CC537D772F1F@CPEMS-KPN501.KPNCNL.LOCAL> References: <2A91BEF8171A5349931391E0C721CC537D772EF8@CPEMS-KPN501.KPNCNL.LOCAL> <3992c5f7d10f011266aeaeb55563920c@etecsa.cu> <2A91BEF8171A5349931391E0C721CC537D772F1F@CPEMS-KPN501.KPNCNL.LOCAL> Disposition-Notification-To: peter@osdev.nl Organization: Open Systems Development B.V. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (mail.osdev.nl [87.253.140.15]); Tue, 24 Dec 2019 11:06:32 +0100 (CET) X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bohr.osdev.nl List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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=', 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@osdev.nl skype : peter_m_groen On Mon, 2019-12-23 at 19:44 +0000, soumik.bhattacharjee@kpn.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.castillo@etecsa.cu > Sent: maandag 23 december 2019 20:34 > To: Bhattacharjee, Soumik > Cc: pgsql-admin@lists.postgresql.org; pgsql-admin@postgresql.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.bhattacharjee@kpn.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@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@SRV:~$ TELNET 10.133.214.32 5432 > > > > Trying 10.133.214.32... > > > > telnet: Unable to connect to remote host: Connection refused