Re: psql remote database access

From: Samed YILDIRIM <samed(at)reddoc(dot)net>
To: Ron Watkins <rwatkins(at)dssolutions(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: psql remote database access
Date: 2016-11-10 13:53:07
Message-ID: 215681478785987@web21o.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<div>Hi,</div><div> </div><div>It is written on error log of psql. Postgres service sees your IP as 10.0.0.254, not 10.42.42.16. Most probably there is a NAT between your box and Postgres service. You should add following entry to pg_hba.conf and restart Postgres.</div><div> </div><div><span style="font-size:8pt;font-family:&quot;Courier New&quot;;">host    all             all             10.0.0.254/32          md5</span></div><div> </div><div>Best regards.</div><div> </div><div><br /></div><div><br /></div><div>İyi çalışmalar.</div><div>Samed YILDIRIM</div><div><br /></div><div><br /></div><div><br /></div><div>10.11.2016, 15:47, "Ron Watkins" &lt;rwatkins(at)dssolutions(dot)com&gt;:</div><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple"><div><p>Im sure this has been addressed somewhere, but I wasn’t able to locate any answers.</p><p>I have a postgres database running on a different host and I need to access it remotely from another box.</p><p> </p><p>Boxes are CentOS 6, and I opened the firewall port 5432 on the database server host.</p><p>Also, on the database server host, I made the following entries to <span style="font-size:8pt;font-family:&quot;Courier New&quot;;">/var/lib/pgsql/9.6/data/pg_hba.conf.</span></p><p><span style="font-size:8pt;font-family:&quot;Courier New&quot;;">local   all             all                                     md5</span></p><p><span style="font-size:8pt;font-family:&quot;Courier New&quot;;">host    all             all             <a href="http://127.0.0.1/32">127.0.0.1/32</a>            md5</span></p><p><span style="font-size:8pt;font-family:&quot;Courier New&quot;;">host    all             all             <a href="http://10.42.42.16/24">10.42.42.16/24</a>          md5</span></p><p><span style="font-size:8pt;font-family:&quot;Courier New&quot;;"> </span></p><p>When I try to use psql to attach to the remote database, I get the following error: </p><p><span style="font-size:8pt;font-family:&quot;Courier New&quot;;">[root(at)host1 ~]# psql -h host2 -p 5432 -U postgres</span></p><p><span style="font-size:8pt;font-family:&quot;Courier New&quot;;">psql: FATAL:  no pg_hba.conf entry for host "10.0.0.254", user "postgres", database "postgres", SSL off</span></p></div></div>
</blockquote>

Attachment Content-Type Size
unknown_filename text/html 2.4 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Samed YILDIRIM 2016-11-10 13:57:44 Re: psql remote database access
Previous Message Ron Watkins 2016-11-09 18:00:24 psql remote database access