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 1qnyBG-00CcZp-5x for pgsql-general@arkaria.postgresql.org; Wed, 04 Oct 2023 09:28:34 +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 1qnyBE-00DaiS-75 for pgsql-general@arkaria.postgresql.org; Wed, 04 Oct 2023 09:28:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qnyBD-00DaiK-Np for pgsql-general@lists.postgresql.org; Wed, 04 Oct 2023 09:28:31 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qnyBB-0087mf-7x for pgsql-general@lists.postgresql.org; Wed, 04 Oct 2023 09:28:30 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-774105e8c37so130345785a.3 for ; Wed, 04 Oct 2023 02:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696411707; x=1697016507; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=jfjqQlp6oIL6m3KrJDqQKUn6elQ8A8K9GkVT8EYsAxQ=; b=gztDwZdRWrSgnLwSQyDO4DvxfxiDXjIMao7Uo/QBx+8tNAB6iw1rBf0g502XsrGRad F71dMBUG9ttGI5wjlTvFUtlIN2rsDAtVdKuT1pKnrj5JXpbIp+sRcy2OdjnvuzNlZBTg wu/wJuKx+go+kWYb98wnIbEO3tTnD0Y8icjuUJBBoxY1tMUEB1tlwl1A0vKPUBONLz++ buD2GE4wY6udmFZwegdBCG67TjG82ThOUbswGsKESz//DZi7O4AU1NwwVUnA1cKlWsAH piq9UCk7dOTPMA/YIekyJ7qtHSpRdih/s/UAJeiYSdIqwU44Z3lV5f3QnHhMhAjwNYxl EM+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696411707; x=1697016507; h=content-transfer-encoding:in-reply-to:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jfjqQlp6oIL6m3KrJDqQKUn6elQ8A8K9GkVT8EYsAxQ=; b=dzY/NiFqKWRAjNHuvUZfQV2aHNmnwyg2nCjyGmIB0tEzj6oM+1E28rp+csmPvtIFLQ /upsntC5v9Iww2PhU3uHZvqYOg3YARZn8hqVn3F5zSx14A+iFweZRNtIrZwl2gvd+s4J aPfZhvMLlxjFYLza6QUltkBAuae+xuVuOohbFF1XanHbiMYIw1a+yqJgMGeMSHURfvcr tbGi0s/qbU4yRzqwwXbBL74ERy4fsmW8PeHDCGTnC7wAF1Bf6mnEe4D8lT+EmsGGyKcb Lx2q0v0BEzD324RmoikAaA2M7jq/csukUI8Fon88NvREjdUILD4Kn4cgUUcTNL0xnxYt ktlA== X-Gm-Message-State: AOJu0YxOwTq9OyeD8WQpSzORyvt1+MT4ReX0XauKVmFE/HgNn/nhgtkK YYMnuldn5d8ztyGT8vLwc/bxi5o1b90= X-Google-Smtp-Source: AGHT+IGVutQpeN0+AB0j7xmnwwLryQwMmnlkBXpGxj62EQjUWUPf/4w0CvjDfi0beRiE0dAsC1SM3A== X-Received: by 2002:a05:620a:22e1:b0:773:db59:5cbf with SMTP id p1-20020a05620a22e100b00773db595cbfmr1689689qki.27.1696411707196; Wed, 04 Oct 2023 02:28:27 -0700 (PDT) Received: from [192.168.2.17] ([70.29.17.173]) by smtp.gmail.com with ESMTPSA id x14-20020ae9e90e000000b00765aa3ffa07sm1120150qkf.98.2023.10.04.02.28.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 02:28:26 -0700 (PDT) From: Amn Ojee Uw X-Google-Original-From: Amn Ojee Uw Message-ID: <1df2db82-132d-9225-5bc6-07d67f359c05@gmail.com> Date: Wed, 4 Oct 2023 05:28:17 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: Peer authentication failed ??? Content-Language: en-CA, es-ES To: pgsql-general@lists.postgresql.org References: <8cac9e3b-f03b-2a6f-f787-958b83775321@gmail.com> <20231003133736.zqxkqrbnmp44kpwg@hjp.at> In-Reply-To: <20231003133736.zqxkqrbnmp44kpwg@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Yes! Thanks so much it worked! On 10/3/23 9:37 a.m., Peter J. Holzer wrote: > On 2023-10-03 05:55:51 -0400, Amn Ojee Uw wrote: >> psql -U my_group_worker -d my_group_db >> >> psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" >> failed: FATAL:  Peer authentication failed for user "my_group_worker" >> >> *** What am I doing wrong? > PostgreSQL uses the first matching rule from pg_hba.conf. Presumably > (because that's the default on Debian/Ubuntu) you have it set up to use > peer authentication on the unix socket and password authentication > (scram or md5) on everything else. > > You are connecting via the Unix socket (/var/run/postgresql/.s.PGSQL.5432), > so the server will attempt peer authentication and nothing else. To get > it to attempt password authentication connect via a tcp socket: > > psql -U my_group_worker -h localhost -d my_group_db > > (More conveniently set up ident authentication for your users, then you > don't need a password.) > > hp >