pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: C. Bensend <benny@bennyvision.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Restricting user -> database access.
Date: Tue, 21 Aug 2001 23:22:16 -0400
Message-ID: <13789.998450536@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.BSO.4.33L2.0108211859190.32016-100000@fusion.bennyvision.com>
References: <Pine.BSO.4.33L2.0108211859190.32016-100000@fusion.bennyvision.com>

"C. Bensend" <benny@bennyvision.com> writes:
> 	I don't see any real way to keep users from connecting
> to their own databases via psql, and then using "\c <otherdb>"
> to connect to someone else's database.

Huh?  \c is checked exactly as tightly as a fresh connection --- it
*is* a fresh connection, as far as the server is concerned.

> 	IS there a way to limit a user's ability to connect
> to only THEIR database?

See "sameuser" option in pg_hba.conf.

> hostssl      bobsdb    a.b.c.d   255.255.255.255   crypt

> This works fine, asks for a password, connects the user, and
> then they can "\c otherdb" without any problem.

The above line does not allow connections to ANY database other than
bobsdb.  If anyone can connect to anything else at all, it's because
you have additional pg_hba lines that you're not showing us.

> hostssl      bobsdb    a.b.c.d   255.255.255.255   ident   sameuser

"sameuser" in the database column (column 2) was what I was talking
about.  "sameuser" as an ident argument is a different concept
altogether.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <13789.998450536@sss.pgh.pa.us>
Permalink:  ../13789.998450536@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13789.998450536@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, benny@bennyvision.com
  Subject: Re: Restricting user -> database access.
  In-Reply-To: <13789.998450536@sss.pgh.pa.us>
  References: <Pine.BSO.4.33L2.0108211859190.32016-100000@fusion.bennyvision.com> <13789.998450536@sss.pgh.pa.us>

* 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