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 1iXnno-00041R-5w for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 14:51:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXnnm-0006Xk-U6 for pgsql-general@arkaria.postgresql.org; Thu, 21 Nov 2019 14:51:22 +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 1iXnlW-0002r7-1K for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 14:49:02 +0000 Received: from mail.wordtothewise.com ([104.225.223.158]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXnlS-00033e-Df for pgsql-general@lists.postgresql.org; Thu, 21 Nov 2019 14:49:01 +0000 Received: from [192.168.0.206] (unknown [37.228.252.243]) by mail.wordtothewise.com (Postfix) with ESMTPSA id 632B89F147 for ; Thu, 21 Nov 2019 06:48:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wordtothewise.com; s=aardvark; t=1574347735; bh=nLtSdZo9q1BSSeITNEJjZJWug5iZwQQm8JHHIzKsqiE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=olwed6i/vpS5qv25Ae/dcJHrAY/NtcDIlJQWpd1HT6FJ9n04bHXzSL5FSmpKC0UPD o3RjrOb9j4v5eTmRqEUCvxUYnaqQWq6oT3QlqYG/0Cl5ErxWPnFLj+okj4V8I44fh2 r+T7P9yDg5g1Lm7XCuV6Ykl+3hHNa7/YMsDUvdyw= Subject: Re: Remote Connection Help To: pgsql-general@lists.postgresql.org References: <18043522-44f4-5ef4-ee15-310d04d4c201@zunibal.com> From: Steve Atkins Message-ID: Date: Thu, 21 Nov 2019 14:48:53 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <18043522-44f4-5ef4-ee15-310d04d4c201@zunibal.com> Content-Type: multipart/alternative; boundary="------------36603FF7BEE257760482AE5D" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------36603FF7BEE257760482AE5D Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 21/11/2019 14:30, Ekaterina Amez wrote: > El 21/11/19 a las 15:21, Jason L. Amerson escribió: >> >> 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 think that's "listen_addresses" on recent versions of postgresql. Did you stop and restart the service after you edited the config file? Check the logs for errors too, maybe. >> 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 >> The first line in pg_hba.conf that matches a connection will take effect; later lines won't. > > For testing connection purposes I'm used to change md5 to trust, this > way you won't have troubles with passwords nor users. > Don't do this on a machine that's reachable from the open internet, ever. It's asking to get your box compromised. >> 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. >> Can you connect to your server on it's external address at all? i.e. if it's external IP address is 10.11.12.13, can you run "psql -h 10.11.12.13" on your ubuntu box and connect / log in? If you can then postgresql is configured correctly and you can focus on where the issue on the network is. If not, then the problem is the local machine, either postgresql configuration or _maybe_ local network configuration silliness. Cheers,   Steve --------------36603FF7BEE257760482AE5D Content-Type: multipart/related; boundary="------------76DFA40567A62AFB2595C6D9" --------------76DFA40567A62AFB2595C6D9 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit


On 21/11/2019 14:30, Ekaterina Amez wrote:
El 21/11/19 a las 15:21, Jason L. Amerson escribió:

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 think that's "listen_addresses" on recent versions of postgresql.

Did you stop and restart the service after you edited the config file? Check the logs for errors too, maybe.


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

The first line in pg_hba.conf that matches a connection will take effect; later lines won't.


For testing connection purposes I'm used to change md5 to trust, this way you won't have troubles with passwords nor users.

Don't do this on a machine that's reachable from the open internet, ever. It's asking to get your box compromised.

 

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.

 

Can you connect to your server on it's external address at all? i.e. if it's external IP address is 10.11.12.13, can you run "psql -h 10.11.12.13" on your ubuntu box and connect / log in?

If you can then postgresql is configured correctly and you can focus on where the issue on the network is.

If not, then the problem is the local machine, either postgresql configuration or _maybe_ local network configuration silliness.

Cheers,
  Steve


--------------76DFA40567A62AFB2595C6D9 Content-Type: image/gif; name="image001.gif" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="image001.gif" R0lGODlhZABkAPcAAJkAM/8zZswAM/8AM/+ZmcwzZv/M/8xmmZkzZmYAM8wzmf+ZzP9mzP+Z //9mmcwAZv8AZv8zmf8Amf8zzP8AzP9m//8z//9QUNYAk5kAZsxmzMwzzMyZ/8xm/8wz/5kz mcwAzMwA/5kAzJkAmcyZzJlmmWYzZmYAmZkzzGYAZpkA/5kz/5lmzDMAM2YzmWYzzGYAzJlm /zMAZmYA/2Yz/8zM/5mZ/5mZzGZmzGZm/2ZmmTMzZjMzmTMAmTMAzDMAzDMz/zMzzABm/wAz zDNm/zNmzAAAZgAAMwAA/wAAmQAzzAAAzDNmmQBmzJnM/2aZ/wAzZmaZzABmmTOZzACZzGbM /zOZ/wAzmQCZ/zPM/wDM/5n//2b//wAzMwD//wDMzACZmWaZmZnMzMz//zPMzGbMzDOZmTNm ZgBmZgAzMwD/zDP/zDPMmQDMmWb/zJn/zAD/mTOZZgBmMzNmM2aZZmbMZpn/mWb/ZjOZM5nM mWb/mTP/mTPMZgDMZmbMmQCZZgCZMzP/ZgD/Zsz/zMz/mZn/Zpn/MwDMMzP/MwDMMzPMMzPM M2b/M2bMMwBmAAAzAACZADPMAGb/AJn/AGbMAADMADPMADOZAJnMZmaZM5nMMzNmAGaZAJnM AMz/Zsz/M8z/AJmZAMzMAMzMMzMzAGZmAJmZM8zMZmZmM5mZZszMmf//zP//mf//Zv//M/// AP/MAP/MZv/MM8yZM5lmAMyZAP+ZAMxmAJkzAMxmM2YzAP+ZZv9mM/+ZM/9mAMwzAJlmMzMA AGYzM5lmZsyZmZkzM8xmZv/MzP8zM8wzM/9mZmYAAJkAAMwAAP8AAP8zAMyZZv/MmczMzJmZ mWZmZjMzMwAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA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