Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opl51-0002b8-Br for pgsql-general@arkaria.postgresql.org; Tue, 01 Nov 2022 06:48:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opl50-000384-6Q for pgsql-general@arkaria.postgresql.org; Tue, 01 Nov 2022 06:48:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opl4z-00037q-RC for pgsql-general@lists.postgresql.org; Tue, 01 Nov 2022 06:48:57 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1opl4x-00012e-3K for pgsql-general@lists.postgresql.org; Tue, 01 Nov 2022 06:48:57 +0000 Received: by mail-wm1-x32e.google.com with SMTP id i5-20020a1c3b05000000b003cf47dcd316so12190297wma.4 for ; Mon, 31 Oct 2022 23:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=HFJNKzdhLDZxfd1RKIrcQXwsxn3OvD/tAsps9RE0clk=; b=UvX2kAzTxaaY3N2l+dJ/eQNScaswE+2xgVc+wY59pLuL1Jk7FopqU8DjMr+LP0ZodV ceBi4W210WJsRCerXNG7pjxTyo+WS2ewcdf2bCjLg1RVzb5v3KvzDe1uzcwkxvF3ow4J 57IqZtKCNmTUaXfvWQ9mqHOILoMtVuYI53Gsm4W5gpJ61AbCqu0VPmmNAuW4ZnyXaNQl uN7GtJ6slX6T46B7oT08zJuOalVPUM3oYnbyJaOmkGOdZ3lKw6Qs2eBuwL7WiTJWCN8s 9AE6yy58UIc8s3aMCcD3xyRKFMWyQ+DRpoq+JJZaMBeVBlLW4WrIVRaFbibb2dL9rfuw /vbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HFJNKzdhLDZxfd1RKIrcQXwsxn3OvD/tAsps9RE0clk=; b=MFIcUcgNSffPAafGZCYtgckmKRuGBp9A+kUQHml/tkYzv12AOXYMYVmiQflaTrwN69 BXcrtz+Qqf6QCjIS54DLFcJfJeJjfcmew+jFJEMR52321moF1MxmwB/fBN/+TQLyUZgD Gs1GQN20cRGV6pdXfGvxOuwnL7XdGKaAJ4J+O07IMZGOBP4cS/iDTD8CVhVzGcBDoCLz mvi3QGJCElucxhDH8ngaoJQX2dE+Df3Cww3AM4cai6dwiUToNBuCxFNbBslWY0ugKIq1 bL1wQENDmiSt4puY+iIGsJzhDxOEGAHBvDIigclhxk1LSrkqh3kL/ySZVmB+EV+wWqrb iZXg== X-Gm-Message-State: ACrzQf2SpdiXGBWDSJKtdMGj4OcHZKDq6OvWHMTWrRd0MZGeFeimKQyr 1aEus4yuLWmH5r4Hf8s8+jzDqA== X-Google-Smtp-Source: AMsMyM466FTeR2C3zfUhQuxkWmPwaYGfJ2Jw9Cn+7cB6jpfx5buxbC39eYGpDtYHf0NxDWdovP/OTw== X-Received: by 2002:a05:600c:3585:b0:3c7:9f:5f87 with SMTP id p5-20020a05600c358500b003c7009f5f87mr21722890wmq.76.1667285333927; Mon, 31 Oct 2022 23:48:53 -0700 (PDT) Received: from localhost.localdomain (178-190-182-20.adsl.highway.telekom.at. [178.190.182.20]) by smtp.gmail.com with ESMTPSA id k36-20020a05600c1ca400b003b47b80cec3sm9768945wms.42.2022.10.31.23.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 23:48:53 -0700 (PDT) Message-ID: <41ba7401df2baa95daed163f946976669a19913c.camel@cybertec.at> Subject: Re: Putting the O/S user for "local" "peer" authentication in the "postgres" group vs chmod'ing the "pg*.conf" files to be readable by "all" From: Laurenz Albe To: Bryn Llewellyn , pgsql-general list Cc: "Peter J. Holzer" , "David G. Johnston" , Adrian Klaver Date: Tue, 01 Nov 2022 07:48:52 +0100 In-Reply-To: <5EDD4790-7982-4610-8371-9E7F9C7F960B@yugabyte.com> References: <5EDD4790-7982-4610-8371-9E7F9C7F960B@yugabyte.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2022-10-31 at 22:03 -0700, Bryn Llewellyn wrote: > I followed Peter's recommendation NOT to put my "clstr_mgr" O/S user in the "postgres" > group—having earlier had it there. But doing so brought this content-free error message > on an attempt to authorize using the intended method: > > Error: Invalid data directory for cluster 11 main That*s a message from the *server*, which always runs under the same OS user. > A bit of Googling got me to this on the pgsql-general list (from the Peter, in fact): > > https://www.postgresql.org/message-id/20190909171519.GA7858%40hjp.at > > on that very topic. > > It seems that the error message is simply misleading and that it should read "Cannot read > the config_file, hba_file, or ident_file" — as they are named in this query's output": > > select name, setting > from pg_settings > where category = 'File Locations'; > > Sure enough, neither my hba_file nor my ident_file were readable by "all" (but they were > readable by "group"). However, the config_file was readable by "all". I've no idea what > the history of those permissions is. Maybe I changed something along the way. I s'pose > that I'd better regard my present installation as a dress rehearsal and simply redo it > starting by restoring my "bare" Linux VM from file backup. > > Anyway, just to prove the point, I chmod'd my hba_file and my ident_file to make them > readable by all. And the silly error message went away. > > However, that feels wrong to me. It would seem proper to put any user who you want to > set up for "local", "peer" authentication into the "postgres" group. > > What do you (all) think? I think that you are doing something very weird, but I have no idea what it is. Please tell us the exact commands you ran. The client user should *never* read the PostgreSQL configuration files, so if changing the permissions (which you should *never* do) has an effect, you must be doing something very strange, like trying to start the database server with the wrong user. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com