Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7M3MfP00561 for ; Tue, 21 Aug 2001 23:22:41 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f7M3MHY13792; Tue, 21 Aug 2001 23:22:21 -0400 (EDT) To: "C. Bensend" cc: pgsql-admin@postgresql.org Subject: Re: Restricting user -> database access. In-reply-to: References: Comments: In-reply-to "C. Bensend" message dated "Tue, 21 Aug 2001 19:24:27 -0500" Date: Tue, 21 Aug 2001 23:22:16 -0400 Message-ID: <13789.998450536@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200108/96 X-Sequence-Number: 2032 "C. Bensend" writes: > I don't see any real way to keep users from connecting > to their own databases via psql, and then using "\c " > 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