Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIvbP-0005rQ-Ne for pgsql-general@arkaria.postgresql.org; Fri, 11 Oct 2019 14:09:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iIvbO-0001LF-CO for pgsql-general@arkaria.postgresql.org; Fri, 11 Oct 2019 14:09:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iIvaz-0006OO-0h for pgsql-general@lists.postgresql.org; Fri, 11 Oct 2019 14:08:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iIvaw-0004Z1-La for pgsql-general@postgresql.org; Fri, 11 Oct 2019 14:08:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x9BE8bKX015706; Fri, 11 Oct 2019 10:08:37 -0400 From: Tom Lane To: La Cancellera Yoann cc: pgsql-general@postgresql.org Subject: Re: Issues with PAM : log that it failed, whether it actually failed or not In-reply-to: References: Comments: In-reply-to La Cancellera Yoann message dated "Fri, 11 Oct 2019 10:38:58 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15704.1570802917.1@sss.pgh.pa.us> Date: Fri, 11 Oct 2019 10:08:37 -0400 Message-ID: <15705.1570802917@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk La Cancellera Yoann writes: > I am having issues with PAM auth : > it works, password are correctly checked, unknown users cannot access, > known user can, everything looks good > But, it always log an error by default even if auth is succesful: > And if auth is unsuccessful, it will log that very same message twice Those aren't errors, they're just log events. If you're using psql to connect, the extra messages aren't surprising, because psql will first try to connect without a password, and only if it gets a failure that indicates that a password is needed will it prompt the user for a password (so two connection attempts occur, even if the second one is successful). You can override that default behavior with the -W switch, and I bet that will make the extra log messages go away. Having said that, using LOG level for unsurprising auth failures seems excessively chatty. More-commonly-used auth methods aren't that noisy. regards, tom lane