pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Jason L. Amerson <drjason@alphagenius.org>
To: PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
Date: Thu, 21 Nov 2019 08:10:51 -0800
Message-ID: <c0d2694e-1fb2-764e-2ecd-9e5a5fd2e038@aklaver.com> (raw)
In-Reply-To: <!&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo/YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAABXPB96Wx2qQItNorifwAzNAQAAAAA=@alphagenius.org>
References: <!&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo/YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAAAse4DPB0qGQZhIy/hSwvrXAQAAAAA=@alphagenius.org>
	<!&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo/YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAABXPB96Wx2qQItNorifwAzNAQAAAAA=@alphagenius.org>

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 <drjason@alphagenius.org>
> *Sent:* Thursday, November 21, 2019 09:22 AM
> *To:* PostgreSQL <pgsql-general@lists.postgresql.org>
> *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





view thread (37+ messages)  latest in thread

Message-ID: <c0d2694e-1fb2-764e-2ecd-9e5a5fd2e038@aklaver.com>
Permalink:  ../c0d2694e-1fb2-764e-2ecd-9e5a5fd2e038@aklaver.com/
Also on:    postgresql.org/message-id/c0d2694e-1fb2-764e-2ecd-9e5a5fd2e038@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, drjason@alphagenius.org
  Subject: Re: Remote Connection Help
  In-Reply-To: <c0d2694e-1fb2-764e-2ecd-9e5a5fd2e038@aklaver.com>
  References: <!&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo/YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAAAse4DPB0qGQZhIy/hSwvrXAQAAAAA=@alphagenius.org> <!&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo/YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAABXPB96Wx2qQItNorifwAzNAQAAAAA=@alphagenius.org> <c0d2694e-1fb2-764e-2ecd-9e5a5fd2e038@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox