pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Bear <David.Bear@asu.edu>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: hba conf ident sameuser not working
Date: Wed, 15 Feb 2006 17:36:10 -0700
Message-ID: <20060216003610.GD11620@asu.edu> (raw)
In-Reply-To: <200602151127.36955.peter_e@gmx.net>
References: <20060215031605.GH14507@asu.edu>
	<200602151127.36955.peter_e@gmx.net>

On Wed, Feb 15, 2006 at 11:27:36AM +0100, Peter Eisentraut wrote:
> David Bear wrote:
> > now, when I connection to postgres from remote machines I ssh into
> > the pg server, but I tunnel postgres traffic. The ident sameuser
> > prevents tunneled connections from working.
> 
> That is not true.  Please give more detail so we can figure out what is 
> really wrong.

ok. 2 machine, mine is called teancum. The server running postgresql
is called dbsrv1.


starting with:
==================
iddwb@teancum:~> ssh -L 6666:localhost:5432 iddwb@dbsrv1
Password:
Last login: Tue Feb 14 20:21:08 2006 from teancum
Have a lot of fun...
iddwb@dbsrv1:~> psql
Welcome to psql 8.0.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

iddwb=> \q
iddwb@dbsrv1:~> psql -U tlhowell
psql: FATAL:  Ident authentication failed for user "tlhowell"

=====================

This is what I expect.

users on dbsrv1 must be who they are.

now, back on teancum that has the tunnel on port 6666, I do this:

===================
iddwb@teancum:~> psql -p 6666 -h localhost -U tlhowell
psql: FATAL:  Ident authentication failed for user "tlhowell"
iddwb@teancum:~> psql -p 6666 -h localhost -U iddwb
psql: FATAL:  Ident authentication failed for user "iddwb"

===================

That is with the following pg_hba.conf

==================

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident sameuser
# IPv4 local connections:
host    all         all         127.0.0.1/32          ident sameuser
# IPv6 local connections:
host    all         all         ::1/128               ident sameuser

===================

Now, if I change the connection for 'host' to use the trust method, I
can connect as any user from psql AFTER I have already authenticated
and setup the ssh tunnel.

> 
> -- 
> Peter Eisentraut
> http://developer.postgresql.org/~petere/

-- 
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"



view thread (5+ messages)  latest in thread

Message-ID: <20060216003610.GD11620@asu.edu>
Permalink:  ../20060216003610.GD11620@asu.edu/
Also on:    postgresql.org/message-id/20060216003610.GD11620@asu.edu

 · 

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: David.Bear@asu.edu, peter_e@gmx.net
  Subject: Re: hba conf ident sameuser not working
  In-Reply-To: <20060216003610.GD11620@asu.edu>
  References: <20060215031605.GH14507@asu.edu> <200602151127.36955.peter_e@gmx.net> <20060216003610.GD11620@asu.edu>

* 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