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 1iXp2q-0006pB-55 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 16:11:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXp2o-0000Fh-VZ for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 16:10:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXp2o-0000Fa-Lt for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 16:10:58 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXp2m-0003lk-81 for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 16:10:58 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 3F3F2D88; Thu, 21 Nov 2019 11:10:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 21 Nov 2019 11:10:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=O D/lVMmuj2WZVBkvpHEVlSWUWPV4753SHqIpbjexrxE=; b=J6g1vTorZPwXHdZLZ 66jKJCdTjNiXLCyL6GoMetJwB9j8q020hi+TmW0iuX92KGDQQ/IRb6h8CUjDSW8X u0gZff5ICsB7tQo9uPF7X+8poO5FGBaWNNa6gfdA1+zmAdEj0p0bl0J4CdJM2zBd lf9NbDS2kBG+Y8ai36YeISsYGfCoelXggFLDNhmf81n+S4gsFkj/xIj/5HHKDLqG TMlgd2dMlMBq320RcDtJK0OJoEQB1R/uAd3Te90IXFYApwZZRia/ZzEGtOWLvRR6 Hqsokhs0tNW/M1cE8pxzfhEza2u+HVKLQ+ysNgyqKH6wAtww9+o707SqfxJZOkJn ECNKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=OD/lVMmuj2WZVBkvpHEVlSWUWPV4753SHqIpbjexr xE=; b=NdF1YOt7JUwulZ3nBozjHDI4skgBz/+Y8dzOsvbYSnAVhg/6Ax7NHjp30 F8ySQK0VfGoNaKrxWnjX13NE3cSQiMgWTGxLX/9t1ZNDhZ+K3D9zVUZTqbdbH3xQ oyOCeHGSDfwRh7o7s6pqJBLjozZXGfDiG04wh8lI9YXD59I+1qCwtQFjtFGVJT42 2aXiMTISFt6DnFIUCFdcc3GiBwi97jOKK1TupvK5Zbww1VoAHqDDltNRsnE/t1/J uvqHlsJ40gHgwqKsx2E6MNFdBCSQLzTsOgbmDanvI1u/ORMjqndUmRGbNkmVaqBD 0gocMm+/OI2GlEHI1o9+11BnO9Vzg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehvddgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeehnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecukfhppeejuddrvdduvddrudeffedrud dukeenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghk lhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.133.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 3532E8005C; Thu, 21 Nov 2019 11:10:52 -0500 (EST) Subject: Re: Remote Connection Help To: "Jason L. Amerson" , 'PostgreSQL' References: From: Adrian Klaver Message-ID: Date: Thu, 21 Nov 2019 08:10:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/21/19 7:15 AM, Jason L. Amerson wrote: > Steve, > > I cannot connect to the server by “psql -h xx.xx.xx.xx.” I can connect > to my Ubuntu machine from other computers using SSH and I can connect to > PostgreSQL if I SSH first. But I cannot connect directly to PostgreSQL > either through a client machine or if I run “psql -h xx.xx.xx.xx” while > using my Ubuntu machine. 1) Is the Postgres server listening on port 5432? 2) What is the full remote connection string you are using? 3) What is the remote machine, a hosted virtual machine, your own physical machine, etc? > > Jason L. Amerson > > *From:*Jason L. Amerson > *Sent:* Thursday, November 21, 2019 09:22 AM > *To:* PostgreSQL > *Subject:* Remote Connection Help > > I am at a loss for what to do. I have read article after article about > how to allow remote connections on my PostgreSQL server and none of what > the articles say do, worked for me. I have edited the “postgresql.conf” > file and changed “listen_address = ‘localhost’ to listen_address = ‘*’. > I have even tried it commented out and uncommented and I get the same > results. I also edited the “pg_hba.conf” file and added the following at > the end of the file: > > host all all 0.0.0.0/0 md5 > > host all all ::/0 md5 > > After that I restart the server, try to connect remotely, and I get > nowhere. I have even added the following rules to my iptables: > > iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx > --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT > > iptables -A OUTPUT -p tcp -s xx.xx.xx.xx --sport 5432 -d 0/0 --dport > 1024:65535 -m state --state ESTABLISHED -j ACCEPT > > My computer that is running the server is Ubuntu and it has a static IP. > I am trying to connect remotely with computers running Windows 10 using > the static IP. When I run pgAdmin from my Windows 10 machine, or use the > command line to connect, I get the following error: > > unable to connect to server: > > could not connect to server: Connection refused (Ox0000274D/10061) Is > the server running on host " xx.xx.xx.xx" and accepting > > TCP/IP connections on port 5432' > > I would like to be able to connect to my Ubuntu PostgreSQL server from > all Windows 10 machines as well as from a client on my Android phone > while away from home. That is my goal now. I am hoping that someone can > help me to get this working. This is been very frustrating. > -- Adrian Klaver adrian.klaver@aklaver.com