Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b08Wb-0004fz-Hq for pgsql-pkg-debian@arkaria.postgresql.org; Tue, 10 May 2016 14:20:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b08Wa-0000mo-T1 for pgsql-pkg-debian@arkaria.postgresql.org; Tue, 10 May 2016 14:20:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b08Wa-0000mg-IX for pgsql-pkg-debian@postgresql.org; Tue, 10 May 2016 14:20:36 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b08WX-0002Jb-Nn for pgsql-pkg-debian@postgresql.org; Tue, 10 May 2016 14:20:35 +0000 Received: from msg.df7cb.de (benz.df7cb.de [IPv6:2001:6f8:10ee:e:134::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 3r41bF3GSfz3Dwl; Tue, 10 May 2016 16:19:21 +0200 (CEST) Date: Tue, 10 May 2016 16:20:31 +0200 From: Christoph Berg To: "Sebastian P. Luque" Cc: pgsql-pkg-debian@postgresql.org Subject: Re: no password on postgres user and pgagent Message-ID: <20160510142030.GD7473@msg.df7cb.de> Mail-Followup-To: Christoph Berg , "Sebastian P. Luque" , pgsql-pkg-debian@postgresql.org References: <87r3daopfm.fsf@otaria.sebmel.org> <20160510090828.GA7473@msg.df7cb.de> <87d1ouvz6v.fsf@otaria.sebmel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d1ouvz6v.fsf@otaria.sebmel.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Pg-Spam-Score: -4.0 (----) X-Mailing-List: pgsql-pkg-debian List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Precedence: bulk Sender: pgsql-pkg-debian-owner@postgresql.org Re: Sebastian P. Luque 2016-05-10 <87d1ouvz6v.fsf@otaria.sebmel.org> > >> I'd like to run pgagent with the postgres user, which doesn't have a > >> password. I thought it'd be as simple as setting up an init script > >> as: > > >> [ -- Begin > >> ---------------------------------------------- ] #! /bin/sh > > >> pgagent user=postgres host=localhost dbname=postgres > > > The default pg_hba.conf requires md5 passwords for "host=localhost" > > connections. > > It's actually set to "peer" in my case (v. 9.5): > > [ -- lines 84 - 85 ------------------------------------------- ] > # Database administrative login by Unix domain socket > local all postgres peer > [ -- End of lines 84 - 85 ------------------------------------ ] > > which is what I want; i.e. get user name from the operating system user > and check that it matches requested database user name. If I understand > right, this means that if I sudo or login as postgres, then that's what > PostgreSQL gets. If postgres has no password and I can login without > one, then the database server shouldn't ask for one. Why does pgagent > expect one? Because you try "host=localhost" which doesn't match the line you are citing. Look for host...md5. Christoph -- Sent via pgsql-pkg-debian mailing list (pgsql-pkg-debian@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-pkg-debian