pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Damian Carey <jamianb@gmail.com>
Cc: Postgresql <pgsql-general@postgresql.org>
Subject: Re: HOWTO? Permissions for user to access a single db
Date: Mon, 13 Feb 2023 18:46:47 -0500
Message-ID: <1521595.1676332007@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+QCafdTcDSR8Gk18XMOQ_mNcfgX8pii7KAd5+C0yXgXstensw@mail.gmail.com>
References: <CA+QCafdWu7Qd13wRdjdyubhCtUMhDsuDUZLHYNA7jvqhWjdxbQ@mail.gmail.com>
	<1510083.1676325588@sss.pgh.pa.us>
	<CA+QCafcdMdBtuiyDF_o2h_wac2MDqUxka82MtwAc-Tq8eRLXWA@mail.gmail.com>
	<1515580.1676328872@sss.pgh.pa.us>
	<CA+QCafdTcDSR8Gk18XMOQ_mNcfgX8pii7KAd5+C0yXgXstensw@mail.gmail.com>

Damian Carey <jamianb@gmail.com> writes:
> Still on a "permissions" theme ... is their any glaring issues that are
> required to provide a random linux user with permissions to access a DB?

Well ... if they can "see" the postgres DB then there should be no such
issues, as they evidently managed to establish a database connection.
However, if we assume that that unnamed connector module is lying through
its teeth and presenting this dialog when it can't connect at all, then
there's a lot more possibilities to consider.

Just stopping to think a minute --- it's unlikely that a lashup such
as you describe would be trying to use a Unix socket file, as local
connections with psql probably do.  Instead, I imagine that the connector
is trying to connect over a TCP connection being tunneled through the
SSH connection.  Obvious things to check then include:

* Is SSH actually being told to provide this tunnel?

* Is the kernel firewall on the Linux machine allowing tunneled packets
to reach the database?

* Is Postgres listening on whichever address/port the tunneled packets
are addressed to?  (This is trickier than it looks, as you have at least
localhost vs. external IP address to consider, not to mention IPv4 vs
IPv6)

* Is pg_hba.conf set up to allow the connection?

Only if the problem is at that last step will log_connections help much;
otherwise, no data is reaching Postgres at all.

			regards, tom lane





view thread (10+ messages)  latest in thread

Message-ID: <1521595.1676332007@sss.pgh.pa.us>
Permalink:  ../1521595.1676332007@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1521595.1676332007@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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jamianb@gmail.com
  Subject: Re: HOWTO? Permissions for user to access a single db
  In-Reply-To: <1521595.1676332007@sss.pgh.pa.us>
  References: <CA+QCafdWu7Qd13wRdjdyubhCtUMhDsuDUZLHYNA7jvqhWjdxbQ@mail.gmail.com> <1510083.1676325588@sss.pgh.pa.us> <CA+QCafcdMdBtuiyDF_o2h_wac2MDqUxka82MtwAc-Tq8eRLXWA@mail.gmail.com> <1515580.1676328872@sss.pgh.pa.us> <CA+QCafdTcDSR8Gk18XMOQ_mNcfgX8pii7KAd5+C0yXgXstensw@mail.gmail.com> <1521595.1676332007@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