X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 783589DC80D for ; Wed, 15 Feb 2006 20:36:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66098-08 for ; Wed, 15 Feb 2006 20:37:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from post5.inre.asu.edu (post5.inre.asu.edu [129.219.110.120]) by postgresql.org (Postfix) with ESMTP id 62B4F9DC800 for ; Wed, 15 Feb 2006 20:36:57 -0400 (AST) Received: from conversion.post5.inre.asu.edu by asu.edu (PMDF V6.1-1X6 #30769) id <0IUR008018CKPG@asu.edu> for pgsql-admin@postgresql.org; Wed, 15 Feb 2006 17:36:20 -0700 (MST) Received: from smtp.asu.edu (smtp.asu.edu [129.219.110.107]) by asu.edu (PMDF V6.1-1X6 #30769) with ESMTP id <0IUR0083Z8CKJD@asu.edu>; Wed, 15 Feb 2006 17:36:20 -0700 (MST) Received: from teancum.pp.asu.edu (teancum.pp.asu.edu [129.219.69.212]) by smtp.asu.edu (8.12.10/8.12.10/asu_smtp_relay, nullclient, tcp_wrapped) with ESMTP id k1G0aJj5026610; Wed, 15 Feb 2006 17:36:20 -0700 (MST) Received: by teancum.pp.asu.edu (Postfix, from userid 1000) id 22F63E98; Wed, 15 Feb 2006 17:36:10 -0700 (MST) Date: Wed, 15 Feb 2006 17:36:10 -0700 From: David Bear Subject: Re: hba conf ident sameuser not working In-reply-to: <200602151127.36955.peter_e@gmx.net> To: Peter Eisentraut Cc: pgsql-admin@postgresql.org Reply-to: David.Bear@asu.edu Message-id: <20060216003610.GD11620@asu.edu> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.5.9i References: <20060215031605.GH14507@asu.edu> <200602151127.36955.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.161 required=5 tests=[AWL=0.160, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.161 X-Spam-Level: X-Archive-Number: 200602/193 X-Sequence-Number: 20614 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"