Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZWQK-004jEa-6d for pgsql-general@arkaria.postgresql.org; Wed, 09 Jul 2025 15:09:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uZWQH-000Bej-Gh for pgsql-general@arkaria.postgresql.org; Wed, 09 Jul 2025 15:09:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uZWQH-000Beb-4T for pgsql-general@lists.postgresql.org; Wed, 09 Jul 2025 15:09:25 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uZWQF-006fxS-27 for pgsql-general@lists.postgresql.org; Wed, 09 Jul 2025 15:09:25 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-40af40aee93so37819b6e.0 for ; Wed, 09 Jul 2025 08:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752073762; x=1752678562; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=HqAKFxjTqUOlpwptgsxnVh3Pfpe2ABOo52UhRC3ZYoo=; b=hEdjdLSw0/JUneWeDnaDf5YrVRifytFJLwUkqVWYP8392VKj+1vD6TLyWjWSFLvEAV N6IN0atO9zJ6/KFt2PpCLzuvkShjUBU1V3KFFTTy+oFCdTw8fHUmh1UrmRljmha0C8Uy hqDHowfYwMHwAE2etwx5UGFVDfmKZm6l5/vsJjFcWOBr9sMPyeh94fWxAFtYZEeV1Tcg DVY7xBAyjM3WUwF8ovQqEO/wky2kI7KY0M1c+0sv0Y2f8ws2hTQWVtlgRPfpqfjDmLC/ DMArNXkn4accn/VasCo4k06SLI94lWXdR+BFAeMHvgDq8BfugS4L5KXjFiUvsqIRts03 eaKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752073762; x=1752678562; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HqAKFxjTqUOlpwptgsxnVh3Pfpe2ABOo52UhRC3ZYoo=; b=l330/9sSBYSy04F/wKOOI+zMjOEkqrUTPEK3GekOjph2yiL/X2VemvtPEAnEDCwrdz bjAGpeCe39YxSy7rvQpcGJqMCQBv2/pedHJSaEh1WMA1gFFdu0UPxwD6nWI6aBoD9qAP ZAi3E/DoSoIox8vsr6TMwVwdJNQTD5qynvXKf1705gXU2nEwQzV0z5kO2zWXGqdTXJMl sTj+9yKAJQyU/RNW2gRWapwnv+OU5Lo9aIKjjp86t7gS0wIGHTb14Xg1+brD9mT3mGO2 nbOxdY3Cu3VqB4dovK7GW8/a4c4/W50oGebYY60GhIccCG42NO5DeV5c1md69vttuTTO vyxA== X-Gm-Message-State: AOJu0YzOK+sqg8Xklxuoio/71NO+8iTphvr8Ml7OEckNmT5bYXfPe3O2 pzw7n1Ge//Tq6EAfF5yE2RWCfrkzGi/y7+iAVzS4zUHgU2QLQumekiK5jUFM3v/fdnZmfey1tPY e+0BL5YwLuN3x/7bkQC+2fkXUp39HgpqMrA== X-Gm-Gg: ASbGnctbIGoErrlrTHNVhL7VqMuzgqDZM5OdgFXwrycUvurulo8nlM3BOp+fpVc6lo3 +OjAf3Y4PBRFMnKGyKlGnVSG/XuqOH/JCyQijkUzxschsAZ52eQtX1JWBB35nVNQ+tv72l1ELhA nwOuwAfNIh8ESgTLbrnfmJZY42ruDOCWMsc5tsVhpDrrCr X-Google-Smtp-Source: AGHT+IGdf2LQje7cqEHptOIiJnDaBzdSMpq/4m8gz+l0a2pjqSk8Yyf038NLVcms/SxzlUfmLj9QApf0ZyW4GzBLVxw= X-Received: by 2002:a05:6808:8196:10b0:408:d05d:8915 with SMTP id 5614622812f47-412bc76309dmr1688163b6e.22.1752073761754; Wed, 09 Jul 2025 08:09:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Wed, 9 Jul 2025 11:09:10 -0400 X-Gm-Features: Ac12FXz34o1wxJ7SNy61na6lq-hx-mZ8JPplNB5AkFPph3Cnjt_oTiqxjwVx8f0 Message-ID: Subject: Re: Password Encryption and Connection Issues To: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000003090be0639807664" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003090be0639807664 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jul 9, 2025 at 10:59=E2=80=AFAM Greg Sabino Mullane wrote: > On Wed, Jul 9, 2025 at 9:57=E2=80=AFAM Alpaslan AKDA=C4=9E > wrote: > >> Is it expected behavior that users created with scram-sha-256 passwords >> can still connect via md5 in pg_hba.conf? > > > Yes. From the docs: > >> To ease transition from the md5 method to the newer SCRAM method, if md5= is >> specified as a method in pg_hba.conf but the user's password on the >> server is encrypted for SCRAM (see below), then SCRAM-based authenticati= on >> will automatically be chosen instead. > > > You can think of "md5" inside pg_hba.conf as "md5 or better" > > As a result, some users are able to connect, while others cannot. > > > Can you expand on this? Nothing you have done should be preventing logins= , > as far as I can tell. > > Best solution: Upgrade everyone to scram, then change md5 to scram in > pg_hba.conf and never look back. > That requires setting the password to null and then recreating the password, no? Otherwise IIRC, changing an md5 password leaves the new password also in md5 format. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --0000000000003090be0639807664 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jul 9, 2025 at 10:59=E2=80=AFAM G= reg Sabino Mullane <htamfids@gmail= .com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">
On Wed, Jul 9, 2025 at 9:57=E2=80=AFAM Alpaslan AKDA=C4=9E <alpaslanakdag@gma= il.com> wrote:
To ease transi= tion from the=C2=A0md5=C2=A0method to the newer SCRAM method, if=C2=A0md5=C2=A0is specified as a method i= n=C2=A0pg_hba.conf=C2=A0but the user's password on the server is encrypted for SCRAM (se= e below), then SCRAM-based authentication will automatically be chosen inst= ead.

You can think of "md5"= ; inside pg_hba.conf as "md5 or better"=C2=A0

As a result, some users = are able to connect, while others cannot.

C= an you expand on this? Nothing you have done should be preventing logins, a= s far as I can tell.

Best solution: Upgrade everyo= ne to scram, then change md5 to scram in pg_hba.conf and never look back.

That requires setting the passwo= rd to null and then recreating the password, no?=C2=A0 Otherwise IIRC, chan= ging an md5 password leaves the new password also in md5 format.
=

--
Death to &= lt;Redacted>, and butter sauce.
Don't boil me, I'm still ali= ve.
<Redacted> lobster!
--0000000000003090be0639807664--