From: "J. Roeleveld" <joost@antarean.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] PosgreSQL - pg_hba.conf localhost access only
Date: Tue, 23 Apr 2013 20:10:12 +0200 [thread overview]
Message-ID: <02354e00-f504-43d7-a22a-608aee8e7724@email.android.com> (raw)
In-Reply-To: <20130423154742.GC19375@syscon7.inet>
Joseph <syscon780@gmail.com> wrote:
>On 04/23/13 15:57, J. Roeleveld wrote:
>>On Tue, April 23, 2013 14:37, Joseph wrote:
>>> On 04/23/13 10:07, J. Roeleveld wrote:
>>>>On Tue, April 23, 2013 02:17, Joseph wrote:
>>>>> In my "pg_hba.conf" I have:
>>>>>
>>>>> local all all trust
>>>>> host all all 127.0.0.1/32
>trust
>>>>>
>>>>> I was under impression that this is configuration is for localhost
>>>>> "127.0.0.1" access only.
>>>>> But to my surprise I can access my database from other machine on
>my
>>>>> network and even from another sub-network that I'm connected to
>via VPN
>>>>>
>>>>> How this authentication/access work?
>>>>
>>>>Normally that should be sufficient.
>>>>On which machine does the client-software run?
>>>>
>>>>--
>>>>Joost Roeleveld
>>>
>>> postgresql server runs on my machine but all other machines on the
>network
>>> including the one on remote location that I'm connected to via VPN
>can
>>> connect to postgresql
>>> database.
>>> I don't want other machine to have access to my server database.
>>>
>>> Even with a single line in pg_hba.conf
>>> local all all trust
>>>
>>> all other machine on the network can connect to my postgresql
>database.
>>
>>If the PostgreSQL database is running on machine X.
>>And you are using machine Y.
>>
>>What command do you type to connect on machine Y?
>>
>>--
>>Joost
>
>I'm using SQL-Ledger (firefox) to access the postgresql.
>Brief history:
>I had a problem in the past when I upgraded to posgresql-9.1, all of a
>sudden I could not access the sql-ledger.
>
>The solution was to add "postgres group" to apache user.
>The reason for it was the change in directory permission:
>
>postgresql 8.x
>drwxrwx--x 2 postgres postgres 4096 Dec 14 19:57 /var/run/postgresql/
>
>postgresql 9.x
>drwxrwx--- 2 postgres postgres 4096 Dec 19 13:21 /var/run/postgresql/
>
>So:
>groups apache
>apache postgres
>
>groups postgres
>postgres
>
>I hope this is correct as adding group "apache" to postgres user does
>not work.
>
>But I just realized that any user from local network can access my
>sql-ledger using browser.
>--
>Joseph
Joseph.
I am guessing Apache is running on the same machine as your Postgresql server?
In this case. The connection will always originate from localhost and Postgresql is behaving as it should.
You will need to secure access to the website to avoid people accessing it.
Kind regards
Joost Roeleveld
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
next prev parent reply other threads:[~2013-04-23 18:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 0:17 [gentoo-user] PosgreSQL - pg_hba.conf localhost access only Joseph
2013-04-23 8:07 ` J. Roeleveld
2013-04-23 12:37 ` Joseph
2013-04-23 13:44 ` Douglas J Hunley
2013-04-23 13:57 ` J. Roeleveld
2013-04-23 15:47 ` Joseph
2013-04-23 18:10 ` J. Roeleveld [this message]
2013-04-23 22:16 ` Joseph
2013-04-24 5:11 ` J. Roeleveld
2013-04-24 12:40 ` Joseph
2013-04-24 20:27 ` J. Roeleveld
2013-04-24 23:48 ` Joseph
2013-04-25 7:14 ` J. Roeleveld
2013-04-25 0:23 ` Joseph
2013-04-25 5:16 ` Dustin C. Hatch
2013-04-25 5:48 ` Joseph
2013-04-25 7:10 ` J. Roeleveld
2013-04-25 12:35 ` Joseph
2013-04-25 16:57 ` J. Roeleveld
2013-04-25 18:26 ` Joseph
2013-04-26 6:59 ` J. Roeleveld
2013-04-27 0:25 ` James Cloos
2013-04-27 1:11 ` Joseph
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02354e00-f504-43d7-a22a-608aee8e7724@email.android.com \
--to=joost@antarean.org \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox